Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
The standard operation here is to always match characters at the  
grapheme cluster boundaries.


Since SARA U is a non-spacing mark, we don't allow partial matching.

Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic  
scripts that some of non-spacing marks are vowels, is cosidered a good  
UI since it's harder for users to determine the paritiel selection  
within a graphic element.


If you really need to do the partial matching, specifying  
NSLiteralSearch flag allows it.


Aki from iPhone


On 2008/12/28, at 21:39, "Gerriet M. Denkmann"   
wrote:




On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  
 wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTER 
 BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN S 
MALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is fo 
und.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite wro 
ng.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
   NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
}
else
{
   NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,  
NSStringFromRange(ra));

};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind though).


What do I do now: write my own version of rangeOfString: ? I would  
rather like to avoid this.



Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to a...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
Actually Thai vowels are not considered a diacritics and, thus, not  
ignored by the flag.


Also, note that, even though it is true we sometimes take advantage of  
ICU from our frameworks, it is an implementation detail and should not  
be considered always true.


In this particular case, we're not using ICU :-)


Aki from iPhone


On 2008/12/28, at 22:13, Ken Ferry  wrote:


Take a look at -[NSString rangeOfString:options:range:locale:].  I'm
not familiar with Thai, but NSDiacriticInsensitiveSearch seems to be
the option required to make this search work.

If you think that there's something wrong with this particular case,
you can file a bug against Cocoa, but you might also want to file one
against ICU, .  It's the ICU tables that
determine string equality in Cocoa.

-Ken

On Mon, Dec 29, 2008 at 12:39 AM, Gerriet M. Denkmann
 wrote:


On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  


wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTE 
R BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN 
 SMALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is  
found.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite wr 
ong.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
  NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba,  
bu );

}
else
{
  NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba,  
bu,

NSStringFromRange(ra));
};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind

though).

What do I do now: write my own version of rangeOfString: ? I would  
rather

like to avoid this.


Kind regards,

Gerriet.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com

This email sent to kenfe...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to a...@apple.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: A Mac App & helper NSStatusItem - how to share preferences

2008-12-29 Thread Steve Cronin

Kyle;

Thanks for that pointer!  Based on the documentation you cited I've  
now got the reading of NSUserDefaults functioning!


In the hopes that it might be useful to someone else, I include these  
'Cocoa friendly' methods.
I grant that there are some improvements which could be made, I  
include them here in the spirit of helpfulness to the community

// myBundleID is a static string defined elsewhere

//retrieves the full user defaults dictionary
- (NSDictionary *) prefDictionary {
CFStringRef appBundleID = (CFStringRef)myBundleID;
	return (NSDictionary *)CFPreferencesCopyMultiple(NULL,  appBundleID,   
kCFPreferencesCurrentUser,  kCFPreferencesAnyHost);

}

//retrieves the string Value of a key  [full implementation of all the  
CFPropertyList types is left as an exercise for the reader)

- (NSString *) prefStringValueforKey:(NSString *)preferenceKey {
CFStringRef appBundleID = (CFStringRef)myBundleID;
	return (NSString*)CFPreferencesCopyValue((CFStringRef)preferenceKey,   
appBundleID,  kCFPreferencesCurrentUser,  kCFPreferencesAnyHost);	

}

//sets the value for a key
- (void) setPrefValue:(id)preferenceValue forKey:(NSString  
*)preferenceKey {

CFStringRef appBundleID = (CFStringRef)myBundleID;
	CFPreferencesSetValue((CFStringRef)preferenceKey,   
(CFPropertyListRef)preferenceValue,  appBundleID,   
kCFPreferencesCurrentUser,  kCFPreferencesAnyHost);	
	CFPreferencesSynchronize(appBundleID, kCFPreferencesCurrentUser,  
kCFPreferencesAnyHost);

}


Steve

On Dec 28, 2008, at 8:17 PM, Kyle Sluder wrote:

On Sun, Dec 28, 2008 at 8:41 PM, Steve Cronin   
wrote:
This not a managed environment nor is this issue related to users  
or hosts,

so it doesn't seem that CFPreferences is called for (or even helps!)


In fact, CFPreferences is exactly what you need.  Apple has some
sample code describing how to do exactly what you want:
http://developer.apple.com/documentation/CoreFOundation/Conceptual/CFPreferences/Tasks/UsingLowAPI.html#/ 
/apple_ref/doc/uid/20001170


--Kyle Sluder


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Framework deployed to 'Resources' not 'Frameworks' in Contents

2008-12-29 Thread Steve Cronin

Folks;

I've got two targets built from the same project:  Big and Little

Big has many resources, source files, as well as several frameworks  
that are copied and then deployed to a 'Frameworks' directory in the  
app file's 'Contents'.
Little has many fewer of the resources and sources and only 1 of the  
framework.s.


Big is just fine: compiles without complaint and runs as expected.

Little's framework however gets deployed to the "Resources' directory  
on build.
Little will compile without any complaints but crash immediately on  
'dyld: Library not loaded: @loader_path/  Reason: image not  
found'.


I've been over the compiler settings until I'm nearly bonkers but I  
just don't see it


Can somebody please give me the conceptual whack I need...

Thanks!
Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Framework deployed to 'Resources' not 'Frameworks' in Contents

2008-12-29 Thread Graham Cox


On 29 Dec 2008, at 8:26 pm, Steve Cronin wrote:


Folks;

I've got two targets built from the same project:  Big and Little

Big has many resources, source files, as well as several frameworks  
that are copied and then deployed to a 'Frameworks' directory in the  
app file's 'Contents'.
Little has many fewer of the resources and sources and only 1 of the  
framework.s.


Big is just fine: compiles without complaint and runs as expected.

Little's framework however gets deployed to the "Resources'  
directory on build.
Little will compile without any complaints but crash immediately on  
'dyld: Library not loaded: @loader_path/  Reason: image not  
found'.


I've been over the compiler settings until I'm nearly bonkers but I  
just don't see it


Can somebody please give me the conceptual whack I need...



You have two targets.

Expanding each target you have a series of operations. One of these  
will be "Copy Files". Its contents will be the framework(s).


Do a Get Info on the "Copy Files" item (not its contents) and choose  
'Frameworks' in the destination pop-up.


hth!

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSSlider: How to set a parameter value?

2008-12-29 Thread Marcelo Cicconet
Hi.How do I use a slider to set a parameter value?
Thanks.
Marcelo C.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSSlider: How to set a parameter value?

2008-12-29 Thread Graham Cox


On 29 Dec 2008, at 9:31 pm, Marcelo Cicconet wrote:


Hi.How do I use a slider to set a parameter value?



What have you tried?

What do *you* mean by 'parameter value'?

Hooking up a slider to another object - usually a controller - you can  
use target/action and bindings, to name the most common.


--Graham
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Find with Nonspacing_Mark

2008-12-29 Thread Gerriet M. Denkmann


On 29 Dec 2008, at 14:46, Aki Inoue wrote:

The standard operation here is to always match characters at the  
grapheme cluster boundaries.


Since SARA U is a non-spacing mark, we don't allow partial matching.

Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic  
scripts that some of non-spacing marks are vowels, is considered a  
good UI since it's harder for users to determine the paritiel  
selection within a graphic element.


If you really need to do the partial matching, specifying  
NSLiteralSearch flag allows it.


Thanks a lot! With NSLiteralSearch everything works perfectly now.

Kind regards,

Gerriet.




On 2008/12/28, at 21:39, "Gerriet M. Denkmann"  
 wrote:




On 29 Dec 2008, at 03:02, "Gerriet M. Denkmann"  
 wrote:



I have a NSTextView which contains "บุ" that is: THAI CHARACTER  
BO

BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a
vowel.

When I use the Find Panel to search for "บ" (using "Contains" or:
"Starts with") nothing is found.

Same in TextEdit; same with any character + Nonspacing_Mark.

When I enter "a" + COMBINING DIAERESIS and search for "ä" (LATIN  
SMALL
LETTER A WITH DIAERESIS) the character, which looks like "ä" is  
found.

Searching for "a" does not find it.
This makes some sense.

But to treat "นุ" as one letter is just plain silly and quite  
wrong.


How can I tell the Find Panel (or the NSTextView) to find my
characters, even if they are followed by some other character?

10.5.6


I tried this:
NSString *bu = @"บุ";
NSString *ba = @"บ";
NSRange ra = [ bu rangeOfString: ba ];
if ( ra.location == NSNotFound )
{
  NSLog(@"%s There is no \"%...@\" in \"%...@\"",__FUNCTION__, ba, bu );
}
else
{
  NSLog(@"%s range of \"%...@\" in \"%...@\" is %@",__FUNCTION__, ba, bu,  
NSStringFromRange(ra));

};

and got the answer:
There is no "บ" in "บุ"
which somehow boggles my mind (might be a problem of aforementioned  
mind though).


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSForm

2008-12-29 Thread AppDev

Hi list,

I was reading up on NSForm but the documentation is a bit 
lacking...(either that or the post christmas period has me in a haze...)


I was wondering two things:
- Is it possible to have multiple items per row (row 1: text field 
spanning 2, row 2: 2 text fields) ?
- Is it possible to have anything other than textfields in the form as 
NSFormCell (radio / check / buttons / dropdowns /... ) ?


Merry Christmas+Happy New Year
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSSlider: How to set a parameter value?

2008-12-29 Thread Marcelo Cicconet
I'd like to control the playback position of a sound managed by the
NSSound class. I just know how to update the playback position based
on the sound current time:

[playbackSlider setFloatValue:[sound currentTime]/[sound duration]];

But how can I move the playback position to another point of the sound
via a slider?

Thanks.
Marcelo.

On Mon, Dec 29, 2008 at 2:47 AM, Graham Cox  wrote:
>
> On 29 Dec 2008, at 9:31 pm, Marcelo Cicconet wrote:
>
>> Hi.How do I use a slider to set a parameter value?
>
>
> What have you tried?
>
> What do *you* mean by 'parameter value'?
>
> Hooking up a slider to another object - usually a controller - you can use 
> target/action and bindings, to name the most common.
>
> --Graham



--
KEEP WORKING
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSSlider: How to set a parameter value?

2008-12-29 Thread Graham Cox


On 30 Dec 2008, at 12:55 am, Marcelo Cicconet wrote:


But how can I move the playback position to another point of the sound
via a slider?



In your controller object, implement an action method like:

- (IBAction)soundTimeAction:(id) sender
{
[mySound setCurrentTime:[sender floatValue] * [mySound duration]];
}

then wire this up as the slider's action using IB.

hth,

Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Google Maps Class / Library

2008-12-29 Thread Joseph Crawford
Anyone know if there is a class or library for working with Google  
Maps in Cocoa?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Pull Down Toolbar Item

2008-12-29 Thread Carmen Cerino Jr.
Howdy,

I would like to create a pull down toolbar item similar to what Xcode
has for a few of its toolbar items. However, I am NOT refering to the
delayed menu. In order to create the item, I started with a subclass
of NSToolbarItem that has a NSPopupButton for its view. The image for
the toolbar item or rather the popup button comes from the first item
since I have the popup button set to pull down mode (as per what the
NSPopupButton documentation states).

The issue I am running into is that the image is not being fully
displayed (see screen capture below). Increasing the size of the
toolbar item solves the issue, but causes the item to be out of
alignment with the rest of the items. The other issue I am running
into is more of a matter of curiosity. If you look at the screen
capture of my custom toolbar item and then look at XCode's toolbar
item, you will notice the location of the pulldown triangle is
different. I am just curious as to how they got it positioned more to
the bottom right of the image vs. the center. My guess is that they
possibly drew the triangle themselves.

My Toolbar Item: http://screencast.com/t/4MKExdXxsO
XCode's Toolbar Item: http://screencast.com/t/TJljMYvfaB

Thanks,
Carmen
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread j o a r


On Dec 29, 2008, at 7:00 AM, Carmen Cerino Jr. wrote:

In order to create the item, I started with a subclass of  
NSToolbarItem that has a NSPopupButton for its view.



Any particular reason to use a subclass? You should be able to use a  
plain NSTollbarItem, and set the pop-up button using "-setView:".



The issue I am running into is that the image is not being fully  
displayed (see screen capture below). Increasing the size of the  
toolbar item solves the issue, but causes the item to be out of  
alignment with the rest of the items.



As you have noted, you need to set the max and min sizes of a toolbar  
item that contains a custom view. In order for your items to line up,  
you probably also need to make sure that they're of similar size. The  
standard size for image style toolbar items is 32x32px.



I am just curious as to how they got it positioned more to the  
bottom right of the image vs. the center. My guess is that they  
possibly drew the triangle themselves.



I think that you're supposed to be able to use the "arrowPosition" and  
"preferredEdge" properties of the pop-up button cell to control where  
the arrow shows up, but I think that Xcode is probably using custom  
artwork in this case.



j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Google Maps Class / Library

2008-12-29 Thread Robert Marini
There are a few floating around but there are any number of licensing  
issues that arise as a result.  Google doesn't provide their tileset  
for cheap and I've not heard of any success stories w/r/t obtaining  
said license from anyone who isn't a huge-ish company.  Your best bet  
would be to construct a properly formatted maps.google.com link.


-rob.

On Dec 29, 2008, at 9:28 AM, Joseph Crawford wrote:

Anyone know if there is a class or library for working with Google  
Maps in Cocoa?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mr. Gecko
Anybody at least knows how to use poseAsClass in 10.5, I think that's  
the problem.


On Dec 28, 2008, at 7:52 PM, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use my  
overridden one?
I've already wrote the cookie system, following the rules of cookie  
security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mike Abdullah
Perhaps you could explain why you've felt the need to write a custom  
cookie storage system? I think it would help us figure the best  
solution. Bear in mind that NSHTTPCookieStorage's design is quite  
complicated in that it synchronises with all instances in other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use my  
overridden one?
I've already wrote the cookie system, following the rules of cookie  
security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How Does Autorelease Pool Work?

2008-12-29 Thread Oleg Krupnov
I am a newbie to Cocoa Memory Management (have been using GC so far),
and I'd like to make sure that my understanding is correct.

Let's assume, for the sake of simplicity, that I don't explicitly
create nested auto-released pools, don't detach new threads, use Cocoa
and AppKit etc., and rely on the framework to create the autorelease
pools for me.

- If my understanding is correct, the auto-release pool is a
relatively short-lived object, that is created at the beginning of
processing each event from the run loop (e.g. a mouse down event) and
disposed on returning back to the run loop. Correct?

- While the auto-release pool exists, it's simply stores all
references to all objects that received -autorelease during processing
the event, correct?

- The auto-release pool does NOT release any objects immediately after
exiting a "declaration scope" (going out of curved brackets {} -
function, cycle, condition etc.). All these objects keep living until
the auto-release pool gets released itself, correct?  In this way
auto-release pools have nothing in common with C++ smart pointers,
that are allocated in the stack memory and automatically call object
destructor on exiting the scope where they were declared. Is this
correct?

- It follows that the actual releasing of objects registered in the
auto-release pool is deferred until the entire call stack is unfolded
back and the control passes to the next event. In this regard,
auto-release pools remind me the garbage collector, where the time of
deallocation is also somewhat indeterminate.

Thanks.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mr. Gecko
Well I'm not wanting to use the default cookie system because I'm  
trying to make a secure browser which wont save the cookies and would  
reset the cookies if inactive and so on so forth.
I did some more tests and tried to do poseAsClass in the main and I  
get this message in the debug output
objc[87202]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: target not immediate superclass


I don't know what that means, because I'm using NSObject as the  
superclass. Do I have to use NSHTTPCookieStorage as the superclass?

This is how my main looks like.
#import 
#import "MYHTTPCookieStorage.h"

int main(int argc, char *argv[])
{
[[MYHTTPCookieStorage class] poseAsClass:[NSHTTPCookieStorage class]];
return NSApplicationMain(argc, (const char **) argv);
}

Thanks for the help,
Mr. Gecko

On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a custom  
cookie storage system? I think it would help us figure the best  
solution. Bear in mind that NSHTTPCookieStorage's design is quite  
complicated in that it synchronises with all instances in other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of cookie  
security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mr. Gecko

when I change it from NSObject to NSHTTPCookieStorage it says this
objc[87581]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: MYHTTPCookieStorage defines new instance  
variables


On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a custom  
cookie storage system? I think it would help us figure the best  
solution. Bear in mind that NSHTTPCookieStorage's design is quite  
complicated in that it synchronises with all instances in other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of cookie  
security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[SOLVED!] Re: Printing a range of text in a particular container --

2008-12-29 Thread John Velman

Thanks, Martin.  I hadn't found the fact that the form feed character (also
\f, inside q quoted string) would cause the break and move to the new
container.  This works for my current testing (I'm just writing a test
program to explore the text system and what tricks I can do with it).  If I
need something that isn't easy to handle this way, I'll go on to multiple
text storage (and text layout) instances.

I tried the "sizing the container to fit the text" briefly, and it's
obviously very problematic.

Considering the prevalence of sidebars and insets in printed material, I'm
surprised that there isn't some discussion of this issue somewhere (at
least I haven't found it...)  Is the Apple Way to just use RTF or XML with
style sheet for this kind of embellishment?   

(I Have been on my iMac for just over a year, previously Linux by
preference, windows by employer. Have been learning Cocoa --as time permits
-- for just over 6 months. ).

Thanks again,

John V.


On Sun, Dec 28, 2008 at 11:23:32PM -0800, Martin Wierschin wrote:
> Hi John,
>
>> If I have a particular range of glyphs that I want to put in,
>> say,textContainer1, and a different (as it happens, contiguous) range I
>> want to put in textContainer2, is there a way to do it?
>>
>> I've tried
>>
>> [layoutManager drawGlyphsForGlyphRange: glyphRangeStringOne 
>> atPoint:startPoint];
>
> In general you don't really tell the text layout system what glyphs you 
> want in which container. You'll note the documentation for the drawing 
> method states:
>
>   "Draws the glyphs in the given glyph range, which must lie completely 
> within a single text container."
>
> Under normal operation you simply give NSLayoutManager the full text and a 
> series of connected containers/views and it figure the rest out for you. If 
> you really must have one chunk of text displayed in one area and a second 
> chunk in another you have these options:
>
> 1. Use a separate NSTextStorage and NSLayoutManager pair for each text 
> chunk.
> 2. Separate the chunks of text in your NSTextStorage by a break character 
> (NSFormFeedCharacter).
>
> There's also an unsavory third option where you size your NSTextContainers 
> so the text happens to break into the second container at exactly the right 
> point. I really wouldn't recommend this approach.
>
> One other thought: if you're really not using NSTextView and are doing all 
> the drawing manually via NSLayoutManager, you might also be able to use a 
> single infinitely tall NSTextContainer. That way NSLayoutManager will 
> always be able to draw the glyph range you request. Just make sure your 
> chunks of text are separated by a newline character so the second block's 
> horizontal offset is flush with the rest of the text.
>
> ~Martin
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How Does Autorelease Pool Work?

2008-12-29 Thread j o a r


On Dec 29, 2008, at 9:00 AM, Oleg Krupnov wrote:

I am a newbie to Cocoa Memory Management (have been using GC so  
far), and I'd like to make sure that my understanding is correct.


- It follows that the actual releasing of objects registered in the  
auto-release pool is deferred until the entire call stack is  
unfolded back and the control passes to the next event.



All of your assertions up until this point are correct.


In this regard, auto-release pools remind me the garbage collector,  
where the time of deallocation is also somewhat indeterminate.



This is not incorrect, but I think that this point can at least be  
argued. It's pretty clear that the time of deallocation would have to  
be considered at least *less* deterministic in GC. In addition, in GC  
you can't (this is of course both and advantage and a disadvantage)  
exert the same amount of manual control (using local autorelease  
pools, or even sidestepping the user of autorelease).


j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread Carmen Cerino Jr.
>
> Any particular reason to use a subclass? You should be able to use a plain
> NSTollbarItem, and set the pop-up button using "-setView:"

 You need to subclass in order to get validation working. That is the only
reason I can think of why it needs to be a subclass

As you have noted, you need to set the max and min sizes of a toolbar item
> that contains a custom view. In order for your items to line up, you
> probably also need to make sure that they're of similar size. The standard
> size for image style toolbar items is 32x32px.
>
The toolbar items are sized at 32x32 for both min and max. When I create the
Popup button control, it is created with a frame of size 32x32 as well. Is
there something I am forgetting to properly size?

Thanks for the info on the arrow. I didn't think of looking down into the
NSPopupButtonCell for those properties. I will give them a try and let you
know how they turn out.

On Mon, Dec 29, 2008 at 11:23 AM, j o a r  wrote:
>
> On Dec 29, 2008, at 7:00 AM, Carmen Cerino Jr. wrote:
>
>> In order to create the item, I started with a subclass of NSToolbarItem
>> that has a NSPopupButton for its view.
>
>
> Any particular reason to use a subclass? You should be able to use a plain
> NSTollbarItem, and set the pop-up button using "-setView:".
>
>
>> The issue I am running into is that the image is not being fully
displayed
>> (see screen capture below). Increasing the size of the toolbar item
solves
>> the issue, but causes the item to be out of alignment with the rest of
the
>> items.
>
>
> As you have noted, you need to set the max and min sizes of a toolbar item
> that contains a custom view. In order for your items to line up, you
> probably also need to make sure that they're of similar size. The standard
> size for image style toolbar items is 32x32px.
>
>
>> I am just curious as to how they got it positioned more to the bottom
>> right of the image vs. the center. My guess is that they possibly drew
the
>> triangle themselves.
>
>
> I think that you're supposed to be able to use the "arrowPosition" and
> "preferredEdge" properties of the pop-up button cell to control where the
> arrow shows up, but I think that Xcode is probably using custom artwork in
> this case.
>
>
> j o a r
>
>
>



-- 
Carmen C. Cerino
  University of Akron ACM Chapter President
  University of Akron Aux. Services Student Assistant
  Cell: 440.263.5057
  AIM: UAcodeweaver
  [ I <3 MACs ]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do I include a URL in a preprocessed Info.plist?

2008-12-29 Thread Isaac Wankerl
On Sat, Dec 27, 2008 at 6:22 AM, Graham Cox  wrote:

> I'm preprocessing my info.plist file so I can automatically update it with
> version number, etc.
>
> I want to include a URL in my plist (to support Sparkle) but Xcode won't
> let me. If I include the URL directly, it causes an error (xml parse error).
> If I define a substitution for it in my plist preprocessing settings, I get
> no error, but only 'http:' is copied, and the rest of the URL is stripped.
>
> How do I do this?
>
> thanks, Graham
>

Here's how I do it...

My build settings have "Expand build settings in info.plist file" and
"Preprocess info.plist file" turned on.

Then in my Info.plist file I have

SUFeedURL  http://www.kerlmax.com/foo

Note that you have to escape one of the slashes in http:// for the parsing
to work.

Isaac
Kerlmax LLC
http://www.kerlmax.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread Carmen Cerino Jr.
The setArrowPosition and preferedEdge methods do not work for me. I followed
the documentation to get the arrow to appear in the lower right corner
pointing down and nothing happens.

On Mon, Dec 29, 2008 at 1:04 PM, Carmen Cerino Jr. wrote:

> Any particular reason to use a subclass? You should be able to use a plain
>> NSTollbarItem, and set the pop-up button using "-setView:"
>
>  You need to subclass in order to get validation working. That is the only
> reason I can think of why it needs to be a subclass
>
> As you have noted, you need to set the max and min sizes of a toolbar item
>> that contains a custom view. In order for your items to line up, you
>> probably also need to make sure that they're of similar size. The standard
>> size for image style toolbar items is 32x32px.
>>
> The toolbar items are sized at 32x32 for both min and max. When I create
> the Popup button control, it is created with a frame of size 32x32 as well.
> Is there something I am forgetting to properly size?
>
> Thanks for the info on the arrow. I didn't think of looking down into the
> NSPopupButtonCell for those properties. I will give them a try and let you
> know how they turn out.
>
> On Mon, Dec 29, 2008 at 11:23 AM, j o a r  wrote:
> >
> > On Dec 29, 2008, at 7:00 AM, Carmen Cerino Jr. wrote:
> >
> >> In order to create the item, I started with a subclass of NSToolbarItem
> >> that has a NSPopupButton for its view.
> >
> >
> > Any particular reason to use a subclass? You should be able to use a
> plain
> > NSTollbarItem, and set the pop-up button using "-setView:".
> >
> >
> >> The issue I am running into is that the image is not being fully
> displayed
> >> (see screen capture below). Increasing the size of the toolbar item
> solves
> >> the issue, but causes the item to be out of alignment with the rest of
> the
> >> items.
> >
> >
> > As you have noted, you need to set the max and min sizes of a toolbar
> item
> > that contains a custom view. In order for your items to line up, you
> > probably also need to make sure that they're of similar size. The
> standard
> > size for image style toolbar items is 32x32px.
> >
> >
> >> I am just curious as to how they got it positioned more to the bottom
> >> right of the image vs. the center. My guess is that they possibly drew
> the
> >> triangle themselves.
> >
> >
> > I think that you're supposed to be able to use the "arrowPosition" and
> > "preferredEdge" properties of the pop-up button cell to control where the
> > arrow shows up, but I think that Xcode is probably using custom artwork
> in
> > this case.
> >
> >
> > j o a r
> >
> >
> >
>
>
>
> --
> Carmen C. Cerino
>   University of Akron ACM Chapter President
>   University of Akron Aux. Services Student Assistant
>   Cell: 440.263.5057
>   AIM: UAcodeweaver
>   [ I <3 MACs ]
>
>


-- 
Carmen C. Cerino
  University of Akron ACM Chapter President
  University of Akron Aux. Services Student Assistant
  Cell: 440.263.5057
  AIM: UAcodeweaver
  [ I <3 MACs ]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread j o a r


On Dec 29, 2008, at 10:59 AM, Carmen Cerino Jr. wrote:

The setArrowPosition and preferedEdge methods do not work for me. I  
followed

the documentation to get the arrow to appear in the lower right corner
pointing down and nothing happens.



Please file a bug report. At the very least, the documentation and  
sample code that is provided should be able to provide better guidance  
for how these properties work (or don't).


j o a r


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread j o a r


On Dec 29, 2008, at 10:04 AM, Carmen Cerino Jr. wrote:

You need to subclass in order to get validation working. That is the  
only

reason I can think of why it needs to be a subclass



Can you describe the type of validation that you're interested in  
performing? Simple validation should work automatically for at least  
the standard Cocoa controls, IIRC.



The toolbar items are sized at 32x32 for both min and max. When I  
create the
Popup button control, it is created with a frame of size 32x32 as  
well. Is

there something I am forgetting to properly size?



Not sure. Perhaps you can provide a screenshot of what the toolbar  
looks like when it's not aligned properly? If you could post a sample  
project that reproduces your problem, that would probably help too  
(preferably over http, and not inline to the list).



j o a r



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [SOLVED--AGAIN] Re: Printing a range of text in a particular container --

2008-12-29 Thread John Velman
Martin -- still thanks, but, I found a fourth method:

NSLayoutManager -setTextContainer:forGlyphRange:

This is embarrassing because I've been pouring over all the text guidelines
and class documentation for days now, and didn't see this until after I got
your response and tried it.   I stumbled on this by accident looking for
something else in the NSLayoutManager documentation.

So here is a fourth alternative, and seems to work quite well (one test so
far).

I can imagine circumstances when the \f would be more convenient, and some
where the -setTextContainer:forGlyphRange: would be more convenient.

Well, thanks again,

John Velman

On Mon, Dec 29, 2008 at 09:21:50AM -0800, John Velman wrote:
> 
> Thanks, Martin. 

[snip]

>
> Thanks again,
> 
> John V.
> 
> 
> On Sun, Dec 28, 2008 at 11:23:32PM -0800, Martin Wierschin wrote:
> > Hi John,
> >
> >> If I have a particular range of glyphs that I want to put in,
> >> say,textContainer1, and a different (as it happens, contiguous) range I
> >> want to put in textContainer2, is there a way to do it?
> >>
> >> I've tried
> >>
> >> [layoutManager drawGlyphsForGlyphRange: glyphRangeStringOne 
> >> atPoint:startPoint];
> >
> > In general you don't really tell the text layout system what glyphs you 
> > want in which container. You'll note the documentation for the drawing 
> > method states:
> >
> > "Draws the glyphs in the given glyph range, which must lie completely 
> > within a single text container."
> >
> > Under normal operation you simply give NSLayoutManager the full text and a 
> > series of connected containers/views and it figure the rest out for you. If 
> > you really must have one chunk of text displayed in one area and a second 
> > chunk in another you have these options:
> >
> > 1. Use a separate NSTextStorage and NSLayoutManager pair for each text 
> > chunk.
> > 2. Separate the chunks of text in your NSTextStorage by a break character 
> > (NSFormFeedCharacter).
> >
> > There's also an unsavory third option where you size your NSTextContainers 
> > so the text happens to break into the second container at exactly the right 
> > point. I really wouldn't recommend this approach.
> >
> > One other thought: if you're really not using NSTextView and are doing all 
> > the drawing manually via NSLayoutManager, you might also be able to use a 
> > single infinitely tall NSTextContainer. That way NSLayoutManager will 
> > always be able to draw the glyph range you request. Just make sure your 
> > chunks of text are separated by a newline character so the second block's 
> > horizontal offset is flush with the rest of the text.
> >
> > ~Martin
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/velman%40cox.net
> 
> This email sent to vel...@cox.net
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Andy Lee

You need to look more closely at the docs for +poseAs:.

--Andy

On Dec 29, 2008, at 12:19 PM, Mr. Gecko wrote:


when I change it from NSObject to NSHTTPCookieStorage it says this
objc[87581]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: MYHTTPCookieStorage defines new  
instance variables


On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a  
custom cookie storage system? I think it would help us figure the  
best solution. Bear in mind that NSHTTPCookieStorage's design is  
quite complicated in that it synchronises with all instances in  
other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of  
cookie security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Sizing text to fit into UITextView

2008-12-29 Thread Steve Wetzel
Is there any easy way to change the size of the font so a string will  
fit into UITextView?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread Andy Lee

On Dec 29, 2008, at 10:00 AM, Carmen Cerino Jr. wrote:

[...] However, I am NOT refering to the
delayed menu.

[...]

look at XCode's toolbar
item, you will notice the location of the pulldown triangle is
different. I am just curious as to how they got it positioned more to
the bottom right of the image vs. the center. My guess is that they
possibly drew the triangle themselves.


Actually it looks to me like they're using a delayed menu.  A single  
click on the Build button triggers a build, and a click-and-hold pops  
up the menu.


--Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Sizing text to fit into UITextView

2008-12-29 Thread Jason Foreman
On Mon, Dec 29, 2008 at 1:57 PM, Steve Wetzel  wrote:
> Is there any easy way to change the size of the font so a string will fit
> into UITextView?

You'll probably want to look at the stuff in the NSString UIKit
additions.  I believe the category is UIDrawing.  There you'll find
various methods to determine the best font size for drawing a string
in a given rect or with a particular width, etc.


Jason
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread Carmen Cerino Jr.
For the clipping issue, I am 95% sure it has to do with how NSPopUpButton
draws the image. If you look at the following screen capture, you will
notice the NSButton and NSPopUpButton differ greatly on how they draw their
images.
http://screencast.com/t/zXY5sLZP

On Mon, Dec 29, 2008 at 3:18 PM, Carmen Cerino Jr. wrote:

> There is no such thing as simple validation for NSToolbarItems with custom
> views. Apple does not implement any validation what so ever when it comes to
> those custom items.
>
> http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Toolbars/Tasks/ValidatingTBItems.html#//apple_ref/doc/uid/2753
>
>
> I am working on cleaning up my sample code to post. I should be able to
> post it in a few hours.
>
>
> On Mon, Dec 29, 2008 at 2:14 PM, j o a r  wrote:
>
>>
>> On Dec 29, 2008, at 10:04 AM, Carmen Cerino Jr. wrote:
>>
>>  You need to subclass in order to get validation working. That is the only
>>> reason I can think of why it needs to be a subclass
>>>
>>
>>
>> Can you describe the type of validation that you're interested in
>> performing? Simple validation should work automatically for at least the
>> standard Cocoa controls, IIRC.
>>
>>
>>  The toolbar items are sized at 32x32 for both min and max. When I create
>>> the
>>> Popup button control, it is created with a frame of size 32x32 as well.
>>> Is
>>> there something I am forgetting to properly size?
>>>
>>
>>
>> Not sure. Perhaps you can provide a screenshot of what the toolbar looks
>> like when it's not aligned properly? If you could post a sample project that
>> reproduces your problem, that would probably help too (preferably over http,
>> and not inline to the list).
>>
>>
>> j o a r
>>
>>
>>
>>
>
>
> --
> Carmen C. Cerino
>   University of Akron ACM Chapter President
>   University of Akron Aux. Services Student Assistant
>   Cell: 440.263.5057
>   AIM: UAcodeweaver
>   [ I <3 MACs ]
>



-- 
Carmen C. Cerino
  University of Akron ACM Chapter President
  University of Akron Aux. Services Student Assistant
  Cell: 440.263.5057
  AIM: UAcodeweaver
  [ I <3 MACs ]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread John Kestner
Hate to be a pest, but had to throw this one up again in case it got  
lost over the holiday. I figure drawing offscreen with subviews  
created in IB has got to be common enough that someone would know the  
right strategy. I can do what I want with [NSString  
drawAtPoint:withAttributes:] but that seems a lot of unnecessary  
layout work when I can do it all in IB. (Unless it's significantly  
more efficient?)


I guess I just don't understand why an NSView will draw all its  
subviews to screen, but when I try doing it offscreen into a file, the  
subviews won't draw without a lot of work. Any advice is appreciated.


John


On Dec 23, 2008, at 9:56 AM, John Kestner wrote:

I've got a custom NSView that displays a visualization and some  
subviews that I placed using Interface Builder that overlay some  
text. This is used as a secondary window that updates when I select  
a name from a list in the primary window, and that works great. And  
it's easy enough to save the current visualization as an image.


Now, I have a Save All Visualizations command that attempts to  
create an offscreen instance of this custom view and iterate through  
all the names, placing the appropriate dynamic text in the subviews  
and saving each in turn. The visualization gets captured in the  
image, but the text in the subviews does not. I'm currently using  
dataWithPDFInsideRect, but I've also tried creating an offscreen  
NSBitmapImageRep, stuffing it in a new graphics context and running  
drawRect on my custom view.


Do I need to ditch IB and programmatically addSubview for each text  
field? I've wracked my brain and the archives trying to figure out  
this one. It may be that my understanding of NSView is poor.


Thanks,
John
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jkestner%40media.mit.edu

This email sent to jkest...@media.mit.edu


--
Bounty Hunter / Research Assistant
Information Ecology, MIT Media Lab
http://web.media.mit.edu/~jkestner

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Pull Down Toolbar Item

2008-12-29 Thread Carmen Cerino Jr.
I am  now 99% sure that its drawing method is doing something awkward. Here
are the results of what happened when I implemented my own draw method:
http://screencast.com/t/FbOLyvgDS

On Mon, Dec 29, 2008 at 3:41 PM, Carmen Cerino Jr. wrote:

> For the clipping issue, I am 95% sure it has to do with how NSPopUpButton
> draws the image. If you look at the following screen capture, you will
> notice the NSButton and NSPopUpButton differ greatly on how they draw their
> images.
> http://screencast.com/t/zXY5sLZP
>
> On Mon, Dec 29, 2008 at 3:18 PM, Carmen Cerino Jr. wrote:
>
>> There is no such thing as simple validation for NSToolbarItems with custom
>> views. Apple does not implement any validation what so ever when it comes to
>> those custom items.
>>
>> http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Toolbars/Tasks/ValidatingTBItems.html#//apple_ref/doc/uid/2753
>>
>>
>> I am working on cleaning up my sample code to post. I should be able to
>> post it in a few hours.
>>
>>
>> On Mon, Dec 29, 2008 at 2:14 PM, j o a r  wrote:
>>
>>>
>>> On Dec 29, 2008, at 10:04 AM, Carmen Cerino Jr. wrote:
>>>
>>>  You need to subclass in order to get validation working. That is the
 only
 reason I can think of why it needs to be a subclass

>>>
>>>
>>> Can you describe the type of validation that you're interested in
>>> performing? Simple validation should work automatically for at least the
>>> standard Cocoa controls, IIRC.
>>>
>>>
>>>  The toolbar items are sized at 32x32 for both min and max. When I create
 the
 Popup button control, it is created with a frame of size 32x32 as well.
 Is
 there something I am forgetting to properly size?

>>>
>>>
>>> Not sure. Perhaps you can provide a screenshot of what the toolbar looks
>>> like when it's not aligned properly? If you could post a sample project that
>>> reproduces your problem, that would probably help too (preferably over http,
>>> and not inline to the list).
>>>
>>>
>>> j o a r
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Carmen C. Cerino
>>   University of Akron ACM Chapter President
>>   University of Akron Aux. Services Student Assistant
>>   Cell: 440.263.5057
>>   AIM: UAcodeweaver
>>   [ I <3 MACs ]
>>
>
>
>
> --
> Carmen C. Cerino
>   University of Akron ACM Chapter President
>   University of Akron Aux. Services Student Assistant
>   Cell: 440.263.5057
>   AIM: UAcodeweaver
>   [ I <3 MACs ]
>



-- 
Carmen C. Cerino
  University of Akron ACM Chapter President
  University of Akron Aux. Services Student Assistant
  Cell: 440.263.5057
  AIM: UAcodeweaver
  [ I <3 MACs ]
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread I. Savant
On Mon, Dec 29, 2008 at 4:02 PM, John Kestner  wrote:

> I guess I just don't understand why an NSView will draw all its subviews to
> screen, but when I try doing it offscreen into a file, the subviews won't
> draw without a lot of work. Any advice is appreciated.

  Just by way of a quick reply, are you sure your subviews are
actually nested subviews in IB? In other words, you're sure you
haven't merely dropped views "atop" your main parent view?

  This is a pretty common mistake for those new to Interface Builder /
Cocoa. Positioning a view so that it is "over" another view does not
make it a subview. This would have the affect you described (if I've
read what you described correctly).

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


newbie question, core data app startup

2008-12-29 Thread Chris Benedict

Hello,

I'm working on a Core Data Application with a custom atomic store for  
encrypting the persistent storage file.  I believe I finally was able  
to get the atomic store working however my problem now is that I need  
to be able to use a user supplied password as an option when  
initializing the persistent store so it gets decrypted.  I'm using  
Cocoa bindings so it seems that the persistent store coordinator is  
started (and fails because of the lack of the decryption key) before I  
have a chance to open a panel and have the user give their password so  
I'm thinking I need a way to somehow delay loading the persistent  
store until i'm ready for it but I'm not sure how to go about doing  
that.


I'm still pretty new to Cocoa and developing on Mac OS X so any advice/ 
pointers on how to do this would be greatly appreciated.


Thanks,
Chris Benedict
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread John Kestner
Yep, they're actual subviews nested in my custom view, double-checked  
by going to list view in IB.


On Dec 29, 2008, at 4:28 PM, I. Savant wrote:


 Just by way of a quick reply, are you sure your subviews are
actually nested subviews in IB? In other words, you're sure you
haven't merely dropped views "atop" your main parent view?



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread I. Savant
On Mon, Dec 29, 2008 at 4:41 PM, John Kestner  wrote:
> Yep, they're actual subviews nested in my custom view, double-checked by
> going to list view in IB.

  You may need to post your "Save All Visualizations" code. This is
hard to "visualize" without it (pun intended).

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


outlineViewSelectionDidChange not always being called on remove

2008-12-29 Thread christophe mckeon gonzalez de leon
hi,

i've got an NSOtlineView, and an NSTreeController
working together with core data. i've just added a
delete menu item which invokes remove like so

if treeController canRemove
treeController remove

the problem is that sometimes when i delete, my
outline view delegate gets sent an outlineViewSelectionDidChange
message, and sometimes not. it depends on what i have been
manually selecting previously.

any ideas, i've been at it for hours and am fresh out.

thanks,
_c
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Quartz Bindings

2008-12-29 Thread Jay Kickliter

Matt, thanks. This suggestion worked:

[patchController setValue[NSNumber numberWithFloat:pitch]  
forKeyPath:@"patch.pitch.value"]


The strange thing is that I tried something almost identical to this  
that didn't work. I can't remember what I did, but your idea is  
working great.


Next step is to figure out where all the memory leaks are. I'm  
processing 20 - 40 strings/sec coming in over a a serial port.


On Dec 27, 2008, at 12:43 PM, Matt Long wrote:


Jay,

I have much more experience using the Core Animation  
QCCompositionLayer where much of this is abstracted, but here are a  
few ideas that might help your situation.


- Are you certain that you can bind to your AppController or does it  
have to be a Cocoa control? I don't know why you couldn't but if you  
read the tech note closely, they are referring specifically to  
binding to Cocoa controls programmatically.


- You could explicitly call [patchController setValue[NSNumber  
numberWithFloat:pitch] forKeyPath:@"patch.pitch.value"] in your  
setter.


- Do you have to set this up programatically? The instructions here http://tinyurl.com/8lo3og 
 show you how to use Interface Builder to achieve the same thing.  
You can then create an outlet to the controller for access in your  
code.


Here's a demo app I did to try to experiment a bit: 
http://www.cimgf.com/files/QCViewBindings.zip

Best Regards,

-Matt




On Dec 27, 2008, at 8:28 AM, Jay Kickliter wrote:


Thanks Matt,

That's what I tried, but it doesn't work. I'm not using a  
QCCompositionLayer. Just a QCView and QCPatchController. Here's the  
code I'm using.


From AppController's AwakeFromNib:

NSMutableDictionary*  options;
options = [NSMutableDictionary new];
	[options setObject:[NSNumber numberWithBool:NO]  
forKey:@"NSConditionallySetsEnabled"];
	[options setObject:[NSNumber numberWithBool:NO]  
forKey:@"NSRaisesForNotApplicableKeys"];
	[self bind:@"pitch" toObject:patchController  
withKeyPath:@"patch.pitch.value" options:options];
	[self bind:@"roll" toObject:patchController  
withKeyPath:@"patch.roll.value" options:options];

[options release];

The setter's and getters:

- (void)setPitch:(float)ptch
{
pitch = ptch;
}

- (float)pitch
{
return pitch;
}

- (float)roll
{
return roll;
}

- (void)setRoll:(float)rll
{
roll = rll;
}

It has a weird behavior in that if I bind an NSSlider to the patch,  
the sphere rotates as it's supposed to. Also, if I bind  
AppController's pitch and roll at the same time, they get updated  
when the NSSlider moves. But, if I call AppController's setPitch  
and setRoll directly, the QC patch's pitch and roll values do not  
get updated.



On Dec 26, 2008, at 11:49 PM, Matt Long wrote:


The quartz composition key paths are going to be:

@"patch.pitch.value"
@"patch.roll.value"

If you are using a QCCompositionLayer, you can simply call [layer  
setValue:[NSNumber numberWithFloat:pitch]  
forKeyPath@"patch.pitch.value"] or even more simply [layer  
setValue:[NSNumber numberWithFloat:pitch] forInputKey@"pitch"].


If you are using a QCView and a Patch Controller, then you'll need  
to look at this: http://developer.apple.com/technotes/tn2005/tn2146.html


HTH,

-Matt



On Dec 24, 2008, at 7:08 AM, Jay Kickliter wrote:

I have a quartz patch with two inputs, "pitch" and "roll". I read  
through the quartz bindings tutorial, and I'm able to bind  
NSSliders to the inputs with no problem. But I don't want to bind  
the inputs to UI elements. I need to bind them to two floats in  
my AppController, also called "pitch" and "roll". I can't seem to  
figure out how to bind a Quartz Controller to my AppController.  
The documentation doesn't tell me anything either. Any ideas?


Jay
___








___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mr. Gecko
Ok I finally got it together, the problem I'm having now is that  
WebView calls [NSHTTPCookieStorage(NSPrivate) _cookieStorage] and than  
goes to debugger.
I know it works because I tried NSLog(@"%@", [[NSHTTPCookieStorage  
sharedHTTPCookieStorage] cookies]); and it outputs an empty array like  
I had it to. and when I add a cookie it outputs that cookie in the  
array.


On Dec 29, 2008, at 1:39 PM, Andy Lee wrote:


You need to look more closely at the docs for +poseAs:.

--Andy

On Dec 29, 2008, at 12:19 PM, Mr. Gecko wrote:


when I change it from NSObject to NSHTTPCookieStorage it says this
objc[87581]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: MYHTTPCookieStorage defines new  
instance variables


On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a  
custom cookie storage system? I think it would help us figure the  
best solution. Bear in mind that NSHTTPCookieStorage's design is  
quite complicated in that it synchronises with all instances in  
other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for  
WebView and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of  
cookie security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the  
list.

Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Very strange behaviour of NSCollectionView

2008-12-29 Thread Sandro Noel

Matteo,

Did you ever get a response on this issue?
Did you find a solution ?
I am having the exact same problem.

Thank you!
Sandro Noel.

On 20-Nov-08, at 4:21 AM, Matteo Manferdini wrote:


Hi everyone.
I'm battling against a very strange behaviour of NSCollectionView.  
To tell
the truth this is not the first time that I have problems with this  
new

class, but other times I have always found a workaround.
I tried to search the web for more information, but all I can find  
are very

basic examples of NSCollectionView use.

Here it is: in my app I have a window attached to the main one which  
opens
when the user double clicks on some items. Inside this window there  
is the
NSCollectionView. It is bound to a normal prototype view made in  
interface

builder, inside of which there are normal text fields bound to the
NSCollectionViewItem representedObject properties. The collection  
view takes
its content from a standard NSArrayController arrangedObjects  
binding. So,
everything is quite standard. The problem is that when this window  
opens,
some of the bindings for the text fields simply don't work and these  
text
fields display their title text instead of the values, while others  
work.
The strangest part is that the bindings that don't work change  
randomly:
sometimes all bindings work, sometimes they don't work at all,  
sometimes
only some of them (randomly chosen) work. Everything is set up the  
same for

each binding.

This strange behaviour is present only when I open the window. If I  
add
items keeping the window open, everything work for the newly added  
items.
The old ones still do not work. If I close the window and then  
reopen it,

everything does not work, even the new items that worked.

Does anyone know what's happening?
Thank you very much.
Cheers.

Matteo Manferdini
Pawn Software
www.pawn-soft.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/sandro.noel%40mac.com

This email sent to sandro.n...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mike Abdullah
The system really isn't designed for this sort of thing sadly :( How  
about instead, setting up a WebResourceLoadDelegate to modify all  
outgoing URL requests doing:


[aRequest setHTTPShouldHandleCookies:NO]

You can then again use the WebResourceLoadDelegate methods to receive  
the URL response and handle the cookie from it as you'd like.


Mike.

On 29 Dec 2008, at 17:17, Mr. Gecko wrote:

Well I'm not wanting to use the default cookie system because I'm  
trying to make a secure browser which wont save the cookies and  
would reset the cookies if inactive and so on so forth.
I did some more tests and tried to do poseAsClass in the main and I  
get this message in the debug output
objc[87202]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: target not immediate superclass


I don't know what that means, because I'm using NSObject as the  
superclass. Do I have to use NSHTTPCookieStorage as the superclass?

This is how my main looks like.
#import 
#import "MYHTTPCookieStorage.h"

int main(int argc, char *argv[])
{
	[[MYHTTPCookieStorage class] poseAsClass:[NSHTTPCookieStorage  
class]];

return NSApplicationMain(argc, (const char **) argv);
}

Thanks for the help,
Mr. Gecko

On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a  
custom cookie storage system? I think it would help us figure the  
best solution. Bear in mind that NSHTTPCookieStorage's design is  
quite complicated in that it synchronises with all instances in  
other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for WebView  
and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of  
cookie security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Overriding NSHTTPCookieStorage for WebView

2008-12-29 Thread Mr. Gecko
so your saying to make it set up the cookies headers for the  
NSURLRequest?

if I do that, how can I get the setcookie header from the server?

On Dec 29, 2008, at 5:25 PM, Mike Abdullah wrote:

The system really isn't designed for this sort of thing sadly :( How  
about instead, setting up a WebResourceLoadDelegate to modify all  
outgoing URL requests doing:


[aRequest setHTTPShouldHandleCookies:NO]

You can then again use the WebResourceLoadDelegate methods to  
receive the URL response and handle the cookie from it as you'd like.


Mike.

On 29 Dec 2008, at 17:17, Mr. Gecko wrote:

Well I'm not wanting to use the default cookie system because I'm  
trying to make a secure browser which wont save the cookies and  
would reset the cookies if inactive and so on so forth.
I did some more tests and tried to do poseAsClass in the main and I  
get this message in the debug output
objc[87202]: MYHTTPCookieStorage: [MYHTTPCookieStorage  
poseAs:NSHTTPCookieStorage]: target not immediate superclass


I don't know what that means, because I'm using NSObject as the  
superclass. Do I have to use NSHTTPCookieStorage as the superclass?

This is how my main looks like.
#import 
#import "MYHTTPCookieStorage.h"

int main(int argc, char *argv[])
{
	[[MYHTTPCookieStorage class] poseAsClass:[NSHTTPCookieStorage  
class]];

return NSApplicationMain(argc, (const char **) argv);
}

Thanks for the help,
Mr. Gecko

On Dec 29, 2008, at 10:57 AM, Mike Abdullah wrote:

Perhaps you could explain why you've felt the need to write a  
custom cookie storage system? I think it would help us figure the  
best solution. Bear in mind that NSHTTPCookieStorage's design is  
quite complicated in that it synchronises with all instances in  
other apps.


Mike.

On 29 Dec 2008, at 01:52, Mr. Gecko wrote:

Hello, I'm trying to make my own cookie storage system for  
WebView and to do that I've found that I need to override  
NSHTTPCookieStorage but when I do that how can I make webview use  
my overridden one?
I've already wrote the cookie system, following the rules of  
cookie security and all, I just need to get this working...


Thanks for the help,
Mr. Gecko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the  
list.

Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net








___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: populate/resize an already open NSMenu in background

2008-12-29 Thread Martin Wierschin

Hi Peter,

I have a menu that needs to be populated on demand, so I've set an  
NSMenu delegate and note the update request in "menuNeedsUpdate:".

...
The problem is that the NSMenu will not resize itself to show  
items added from outside of "menuNeedsUpdate:".

...
A third possible cause is that you're on Tiger.  Changing a menu  
while it is open is only supported on Leopard.


This was exactly it, as I still do most of my development on ye olde  
Tiger. Everything works perfectly on Leopard. Not a big deal in this  
case to make the feature 10.5 only.


Thanks for your help! Cheers,

~Martin

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [SOLVED!] Re: Printing a range of text in a particular container --

2008-12-29 Thread Martin Wierschin
Considering the prevalence of sidebars and insets in printed  
material, I'm surprised that there isn't some discussion of this  
issue somewhere (at least I haven't found it...)  Is the Apple Way  
to just use RTF or XML with style sheet for this kind of  
embellishment?


I think it's probably expected that different content streams (eg:  
sidebar vs document body) are contained in different NSTextStorage  
instances, and thus will have separate layout managers. I think it  
would be rather messy business to keep logically disjoint pieces of  
content in a single storage.


~Martin

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Scrollwheel ignores line scroll setting in NSScrollView - bug?

2008-12-29 Thread Graham Cox
The scrollwheel input ignores NSScrollView's -setVerticalLineScroll:  
setting.


Is this intentional, or should I file a bug?

Is there a way to fix this behaviour other than subclassing that I've  
missed? It's pretty annoying.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Steve Cronin

Folks;

I have some methods which might be handled by one of several objects.
So I have a set of   if ( [objectX  
respondsToSelector:@selector(foo)] )  {... } else if ( [objectY  
respondsToSelector:@selector(foo)] ) {... } 


The functionality is fine but the compiler warnings for "no 'foo'  
method found" bug me.

Call me finicky if you want but I love spanking clean compiles.

I can, of course, silence the compiler by #import the headers for  
ObjectX and ObjectY.
But this leads to a level of dependancy and obfuscation that my gut  
doesn't like.

Later I find myself asking "Huh, I wonder why this header is here?"
Or worse: "Dang, I can't just re-use this object here without also  
dragging along that object?..arrghh"


So at the moment I add inline comments to the #imports statements to  
aid in these later questions but this feels lame and is tedious as  
well as error prone.


I realize that the runtime selection of the foo handler is the root  
issue and I cannot ignore this when I might reuse.

So I don't want to 'bury' the issue.
But a full header import for the sake of a method or two seems onerous.

What do others think of this dilemma?
Should I just be glad of the warnings and get over it?
Am I getting too worked up on the #import issue?
Is there a compiler flag I could toggle on/off to suit? (XC3.1)
Steve
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Kyle Sluder
On Mon, Dec 29, 2008 at 11:49 PM, Steve Cronin  wrote:
> Call me finicky if you want but I love spanking clean compiles.

Not finicky; appropriately cautious.  But this is going to happen
whenever you start deciding to invoke methods based on
-respondsToSelector:.  The compiler needs to know some aspects of the
selector's type signature in order to generate the correct code.
Otherwise it's going to start passing arguments on the stack when they
should be in floating-point registers or making other such mistakes.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


paragraph styles in NSTextView--help

2008-12-29 Thread rethish
hi,

I want to use different combinations of paragraph styles in nstextview .

for example : combination of linespacing, paragraphspacing, headindent and
tailindent . These all styles must be activated in a single operation ,such
as in a single buttonclick etc.


Is this possible?
please help.

thankyou 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Graham Cox


On 30 Dec 2008, at 3:49 pm, Steve Cronin wrote:

The functionality is fine but the compiler warnings for "no 'foo'  
method found" bug me.

Call me finicky if you want but I love spanking clean compiles.


On the contrary, clean compiles with no warnings (even with many extra  
warnings enabled) is the hallmark of the meticulous programmer.  
Warnings are there to tell you something is probably wrong with your  
code, or at least to make you think about issues (like unused  
parameters).


I can, of course, silence the compiler by #import the headers for  
ObjectX and ObjectY.
But this leads to a level of dependancy and obfuscation that my gut  
doesn't like.

Later I find myself asking "Huh, I wonder why this header is here?"
Or worse: "Dang, I can't just re-use this object here without also  
dragging along that object?..arrghh"


So at the moment I add inline comments to the #imports statements to  
aid in these later questions but this feels lame and is tedious as  
well as error prone.


I realize that the runtime selection of the foo handler is the root  
issue and I cannot ignore this when I might reuse.

So I don't want to 'bury' the issue.
But a full header import for the sake of a method or two seems  
onerous.



You have no choice but to import the headers, or import a secondary  
header that contains just those methods, though that might be even  
more problematic at some future date. To call those methods properly,  
the compiler needs to know about them and it gets that info from the  
header. You can't skip it and hope for the best.


I'm not sure why you feel this is a dependency too far - fact is, your  
code does depend on those methods and the objects that implement them,  
so importing the header is correct. It's not unusual for a .m file to  
import dozens of headers. The dependencies are occasionally a nuisance  
when porting code to another project but often refactoring of other  
code can alleviate it. What you definitely don't want to trap yourself  
with is importing more than a very minimal number of headers into a  
header - the dependencies that sets up are worse to deal with because  
they are not immediately visible.


--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSColorWell shows no color

2008-12-29 Thread tobias assmann
Hello all,

I hope my question is not that stupid. I wouldn`t ask, if I knew anything more 
to do. Seems like I am stuck with this:

I use some NSColorWell objects in a preference section of my view. User can 
chosse so me colors there. All works fine exept one thing. The NSColorWell 
objects are initialized with default values out of a NSColorList when the UI is 
opened. But the NSColorWell objects show the color white. When a NSColorWell is 
clicked the color that is supposed to be selected shows up in the NSColorWell 
and the default selctor as well. It would be nice to see the color, without the 
need to click NSColorWell. I have really no idea what my be wrong. This is the 
code, which I use in the draw method of the view containing the NSColorWells:

// Fill the colorWells
[uiBgColorWell setColor:[topv..colors colorWithKey:@"bg"]];
[uiBlinkColorWell setColor:[topv.colors colorWithKey:@"blink"]];
[uiActivBeatColorWell setColor:[topv.colors colorWithKey:@"activeBeat"]];
[uiInactiveBeatColorWell setColor:[topv.colors colorWithKey:@"inactiveBeat"]];

Anyone with an idea to this is very very welcome :-)

Greets

Tobias




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


SOAP Client - OpenSource - looking for supporting developpers

2008-12-29 Thread Marc De Roover

Ladies & Gentlemen,


Allow me te introduce to you some superb developer tools by Todd Ditchendorf:

http://www.scan.dalo.us/


One of these tools is SOAP Client:

SOAP Client is a free Cocoa-based developer tool for Mac OS X Tiger 
that allows you access and debug WSDL & SOAP-based Web Services from 
the comfort of your desktop.


SOAP Client is now an opensource project

http://code.google.com/p/mac-soapclient/


As some additional work needs to be done and the tools is such a 
great help when ever you are confronted. I do hereby a call for 
support for the project.



Un fortunately i don't have cocoa capabilities, but the above 
mentioned tool saved me hours in project where i was confronted with 
WebServices.



One issue the actual program is lacking ( which I'm confronted with )

Support for complex types ( Array's )


If intrested in supporting this project please contact the developers 
on the above mentioned website,



Thanks in advance,





Marc
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Help using NSAppleScript

2008-12-29 Thread automandc
I am new to Cocoa/Objective-C and new to the forum, so apologies if this is  
a newbie questions.


I am trying to use NSAppleScript from Objective-C to execute the following  
one liner, and covert the result into an NSRect:


"Tell application \"Finder\" to return (bounds of window of desktop)"

When I call the compileAndReturnError method of NSAppleScript it crashes  
the debugger. I also am not sure how to actually access the result of the  
NSAppleScript call once I get the script to run.


I would be grateful if someone can offer advice and/or a pointer in the  
right direction to getting this to work.


Thanks in Advance
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Notification when NSPersistentDocument done loading model

2008-12-29 Thread Richard Ashwell
If I understand Philip, I am having the same challenge, It isn't  
enough for me to let NSPersistentDocument do the load, I want a  
notification or some way of knowing after the load is completed so  
that I can fix up other related stuff.  Is there someway to at a  
minimum:


1) In some overridden method of NSPersistentDocument subclass for my  
document as an example:


- (void)windowControllerDidLoadNib:(NSWindowController  
*)windowController


2) To test for when the nib loaded via the NSPersistentDocument's open  
event or was it instead via the new document event.


I am new to all of this please be gentle and Philip was here first, If  
I misread his question and mine is completely different?


Thanks in advance for any advice,

Richard


On Dec 22, 2008, at 5:58 PM, PHILIP GRANDINETTI wrote:

I'm using a Core Data model and letting NSPersistentDocument manage  
the task of finding and loading the application's model.   My model  
contains data that I am displaying in a graph (SM2DGraphView)   A  
problem I'm having is that once the model data is done loading I  
want to send a refresh message to the graph. So, I put the  
refresh message at the end of the document's  initWithType:error:   
but this seems to be too early in the process and when the refresh  
asks the NSArrayController bound to the data, it says it is empty,  
that is, canRemove returns false.


I tried getting a notification with  
NSManagedObjectContextObjectsDidChangeNotification but this didn't  
seem to work.   I can post the code in case this should have worked,  
but first I wanted to ask if there might be a simpler approach?


Thanks,

Philip

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rashwell%40me.com

This email sent to rashw...@me.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Newline and Carriage return problem..

2008-12-29 Thread Ramachandra V N

Hi all,
	I need to parse a file that existed in server and that file and its  
data is created by Window's exe.
Since after each line two characters will be appended, that is one is  
new line and carriage return.


	However, if I create the file(Created by Mac App), after appending  
new line character nothing will be appended. 	
I am getting problem in this file parsing. Any idea or suggestions  
will be greatly appreciated.




Regards,
Ramachandra













___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSOutlineView

2008-12-29 Thread Mahaboob
My application uses an NSPopupButton and NSOutlineView. PopupButton shows
all the table names in the database and the outlineView displays the data in
the corresponding table selected from the popupButton. It is working fine. I
also need to display one default table's data in the outlineView when I'm
opening this window. So in the opening method of the window I called the
same method used for the PopupButton's selection changed, and it runs that
method but it doesn't fires the events for the OutlineView. So the
outlineView shows nothing. How can I fires the events for outlineView in
this method ?

Thanks in advance
Mahaboob


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Ken Thomases

On Dec 29, 2008, at 10:56 PM, Kyle Sluder wrote:

On Mon, Dec 29, 2008 at 11:49 PM, Steve Cronin  
 wrote:

Call me finicky if you want but I love spanking clean compiles.


Not finicky; appropriately cautious.  But this is going to happen
whenever you start deciding to invoke methods based on
-respondsToSelector:.  The compiler needs to know some aspects of the
selector's type signature in order to generate the correct code.
Otherwise it's going to start passing arguments on the stack when they
should be in floating-point registers or making other such mistakes.


To be clear, it's not the -respondsToSelector: expressions that are  
causing the warnings, it's the eventual invocations of the methods  
when you decide that some object does respond to them.


If the method satisfies the signature requirements of one of the - 
performSelector:... methods (defined in the NSObject _protocol_), then  
you can use those to side-step the compiler warning.


Cheers,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


iTunes Scripting Bridge examples?

2008-12-29 Thread Scott Anguish
Does anyone have any examples of using the Scripting Bridge with  
iTunes?  Specifically how you get the currently selected tracks  
returned as an array of iTunesTrack items.


Thanks
Scott
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Create UILabel to fit into text size

2008-12-29 Thread Tharindu Madushanka
Hi
I am new to iPhone application development and please help me on this.
I need to add the contents in a text field to a UILabel. But I can't guess
how long the string in the text field be. There fore, can I make a UILabel
from the text ( I mean to fit the text to UILabel size). I have searched but
could not find a solution. Please help me on this with some code.
I think if I get a CGRect object with some string it could set as UILabel's
frame. can you suggest some code segment to do this.
Thank you
Tharindu
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Create UILabel to fit into text size

2008-12-29 Thread Dave DeLong
If you look in the NSString (UIStringDrawing) documentation, you'll  
see that NSString has a -sizeWithFont: method that returns a CGSize,  
which will be the bounding box for that string when its drawn with the  
passed in UIFont.  You can then use that size as part of the CGRect  
for constructing a UILabel.


If you need to control things like wordwrap and whatnot, check out the  
related methods.


HTH,

Dave

On 29 Dec, 2008, at 9:20 PM, Tharindu Madushanka wrote:


Hi
I am new to iPhone application development and please help me on this.
I need to add the contents in a text field to a UILabel. But I can't  
guess
how long the string in the text field be. There fore, can I make a  
UILabel
from the text ( I mean to fit the text to UILabel size). I have  
searched but

could not find a solution. Please help me on this with some code.
I think if I get a CGRect object with some string it could set as  
UILabel's

frame. can you suggest some code segment to do this.
Thank you
Tharindu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Bill Bumgarner

On Dec 29, 2008, at 9:09 PM, Ken Thomases wrote:
To be clear, it's not the -respondsToSelector: expressions that are  
causing the warnings, it's the eventual invocations of the methods  
when you decide that some object does respond to them.


If the method satisfies the signature requirements of one of the - 
performSelector:... methods (defined in the NSObject _protocol_),  
then you can use those to side-step the compiler warning.


Right -- or you can declare the methods somewhere and then import them.

I would suggest looking at various patterns within the AppKit and  
Foundation that do this kind of thing.  In particular, anything that  
implements a delegate of some kind will typically declare an informal  
interface on NSObject like this:


@interface NSObject  
(MyClassOptionalMethodsThatMightBeImplementedByJustAboutAnything)

- (void) someSpecial: (Sauce *) aSauce;
- (BOOL) isBobYourUncle: (Child *) aChild;
@end

As long as the header containing the above is imported, then  
invocations of the methods declared will never generate a warning (as  
long as said methods are implemented on a subclass of NSObject, anyway).


b.bum

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Steve Cronin

Folks;

Thanks for the rapid and thought-provoking responses!!

Ken - I don't understand what you said about the method's signature's  
compliance with NSObject _protocol_.
I looked at the protocol definition in the documentation and I just  
don't understand well enough to see what I could do to "side-step" the  
warnings,

Would you be willing to spend another sentence or two on that?

Bill - OK I have a lot to learn - studying AppKit's delegate  
implementation is a to-do!  (gulp)
In the meantime, tweaked your snippet and just added this at the end  
of the header of the class where the -respondsToSelector: issue arose:


//respondsToSelector silencer - see -myMethodName
@interface NSObject (MyClassName)
- (id) foo;
@end

This silences the compiler without any #import being required in  
the .m file AND allows me to document to issue in the header where it  
seems to me it belongs. YAY!! Any downsides to this?
I assume I could implement this declaration with the actual return  
expected (e.g. (NSDictionary*)) and squeeze even more assistance out  
that hard-working compiler, right?


Thanks to all of you: Kyle, Graham, Ken and Bill for sharing your time  
and your knowledge!

Steve

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread John Kestner
So am I right in believing that drawRect: should not need to be  
explicitly called in each subview from within my custom view's  
drawRect:? In any case, see if you can make sense of this...



// This is in my controller:
- (IBAction) saveAllVisualizations: (id)sender
{
NSRect pRect = NSMakeRect(0, 0, 480, 640);
PlantView *pView = [[PlantView alloc] initWithFrame: pRect];
	NSManagedObjectContext *context = [[NSApp delegate]  
managedObjectContext];


NSFetchRequest *fetchAllPersons = [[NSFetchRequest alloc] init];
	[fetchAllPersons setEntity: [NSEntityDescription  
entityForName:@"Person" inManagedObjectContext:context]];


	for (PersonMO *p in [context executeFetchRequest:fetchAllPersons  
error:nil])

{
[pView save:p];
}
}

// This is in my custom view:
- (IBAction) save: (id) sender
{   
NSString *personName = [sender name];

NSRect pRect = NSMakeRect(0, 0, 480, 640);
NSBitmapImageRep* offscreenRep = nil;
offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil

   pixelsWide:pRect.size.width

   pixelsHigh:pRect.size.height

bitsPerSample:8

  samplesPerPixel:4

 hasAlpha:YES

 isPlanar:NO

   colorSpaceName:NSCalibratedRGBColorSpace

 bitmapFormat:0

  bytesPerRow:(4 * pRect.size.width)

 bitsPerPixel:32];
[NSGraphicsContext saveGraphicsState];
	[NSGraphicsContext setCurrentContext:[NSGraphicsContext  
graphicsContextWithBitmapImageRep:offscreenRep]];


[self drawRect:pRect];

	NSString *fileName = [NSString stringWithFormat: @"~/Desktop/%...@.jpg",  
personName];

NSString *filePath = [fileName stringByExpandingTildeInPath];
	NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: 
[NSNumber numberWithFloat:1.0], NSImageCompressionFactor, nil];


	NSData *data = [offscreenRep representationUsingType:NSJPEGFileType  
properties:dict];

[data writeToFile:filePath atomically:YES]; 

[NSGraphicsContext restoreGraphicsState];
}



On Dec 29, 2008, at 4:53 PM, I. Savant wrote:

On Mon, Dec 29, 2008 at 4:41 PM, John Kestner  
 wrote:
Yep, they're actual subviews nested in my custom view, double- 
checked by

going to list view in IB.


 You may need to post your "Save All Visualizations" code. This is
hard to "visualize" without it (pun intended).


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Help using NSAppleScript

2008-12-29 Thread Rob Keniger


On 29/12/2008, at 9:04 AM, automa...@gmail.com wrote:

I am new to Cocoa/Objective-C and new to the forum, so apologies if  
this is a newbie questions.


I am trying to use NSAppleScript from Objective-C to execute the  
following one liner, and covert the result into an NSRect:


"Tell application \"Finder\" to return (bounds of window of desktop)"

When I call the compileAndReturnError method of NSAppleScript it  
crashes the debugger. I also am not sure how to actually access the  
result of the NSAppleScript call once I get the script to run.


I would be grateful if someone can offer advice and/or a pointer in  
the right direction to getting this to work.



I have no idea how you are managing to "crash the debugger" with this  
code. I also don't understand why you are using AppleScript to get the  
dimensions of the desktop. You should be using the Cocoa NSScreen  
class if you want to find out screen dimensions.


Here is one way that you could get the bounds using AppleScript from  
the Finder using your source. Note that I have done no sanity checking  
of the NSAppleEventDescriptor that is returned:


NSAppleScript* script=[[NSAppleScript alloc] initWithSource:@"tell  
application \"Finder\" to return (bounds of window of desktop)"];

NSDictionary* scriptError=nil;
NSAppleEventDescriptor* descriptor=[script  
executeAndReturnError:&scriptError];

if(scriptError)
{
NSLog(@"Error: %@",scriptError);
return;
}

NSRect desktopFrame;
desktopFrame.origin.x=(CGFloat)[[descriptor descriptorAtIndex:1]  
int32Value];
desktopFrame.origin.y=(CGFloat)[[descriptor descriptorAtIndex:2]  
int32Value];
desktopFrame.size.width=(CGFloat)[[descriptor descriptorAtIndex:3]  
int32Value];
desktopFrame.size.height=(CGFloat)[[descriptor descriptorAtIndex:4]  
int32Value];


//note that this does not return an origin in Cocoa base coordinates  
for multiple-monitor systems

NSLog(@"Desktop frame: %@",NSStringFromRect(desktopFrame));

Here is how you would find out the size of the desktop using the  
NSScreen class, which will be much faster and more reliable, as well  
as returning a result in Cocoa base coordinates:


NSRect desktopFrame=NSZeroRect;
for(NSScreen* screen in [NSScreen screens])
{
desktopFrame=NSUnionRect(desktopFrame, [screen frame]);
}
NSLog(@"Desktop frame: %@",NSStringFromRect(desktopFrame));


--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Saving unseen NSView with subviews to NSImage

2008-12-29 Thread Rob Keniger


On 30/12/2008, at 4:11 PM, John Kestner wrote:

So am I right in believing that drawRect: should not need to be  
explicitly called in each subview from within my custom view's  
drawRect:? In any case, see if you can make sense of this...



Seems way too complicated to me. I have this in a category on NSView,  
which returns an NSImage of the view's content, including all subviews:


-(NSImage*) bitmapImageInRect:(NSRect) rect
{
	NSBitmapImageRep* imageRep=[self  
bitmapImageRepForCachingDisplayInRect:rect];
	NSGraphicsContext *previousContext = [NSGraphicsContext  
currentContext];
	[NSGraphicsContext setCurrentContext:[NSGraphicsContext  
graphicsContextWithBitmapImageRep:imageRep]];

[[NSColor clearColor] set];
NSSize imageRepSize = [imageRep size];
NSRectFill(NSMakeRect(0, 0, imageRepSize.width, imageRepSize.height));
[NSGraphicsContext setCurrentContext:previousContext];
[self cacheDisplayInRect:rect toBitmapImageRep:imageRep];
NSImage* bitmapImage=[[NSImage alloc] initWithSize:rect.size];
[bitmapImage addRepresentation:imageRep];
return bitmapImage;
}

You could of course modify this to return the NSData from a - 
representationUsingType:properties: call on the NSBitMapImageRep.


--
Rob Keniger



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Notification when NSPersistentDocument done loading model

2008-12-29 Thread Dave Fernandes


On Dec 28, 2008, at 7:31 PM, Richard Ashwell wrote:

If I understand Philip, I am having the same challenge, It isn't  
enough for me to let NSPersistentDocument do the load, I want a  
notification or some way of knowing after the load is completed so  
that I can fix up other related stuff.  Is there someway to at a  
minimum:


1) In some overridden method of NSPersistentDocument subclass for  
my document as an example:


- (void)windowControllerDidLoadNib:(NSWindowController *) 
windowController


windowControllerDidLoadNib: would be a perfectly good place to do  
initialization after the document has been "loaded".




2) To test for when the nib loaded via the NSPersistentDocument's  
open event or was it instead via the new document event.


I am new to all of this please be gentle and Philip was here first,  
If I misread his question and mine is completely different?


Thanks in advance for any advice,

Richard


On Dec 22, 2008, at 5:58 PM, PHILIP GRANDINETTI wrote:

I'm using a Core Data model and letting NSPersistentDocument  
manage the task of finding and loading the application's model.
My model contains data that I am displaying in a graph  
(SM2DGraphView)   A problem I'm having is that once the model data  
is done loading I want to send a refresh message to the graph.  
So, I put the refresh message at the end of the document's   
initWithType:error:  but this seems to be too early in the process  
and when the refresh asks the NSArrayController bound to the data,  
it says it is empty, that is, canRemove returns false.


initWithType:error: is only called for new documents, not for  
previously existing documents when re-opened.


initWithContentsOfURL:ofType:error: is called for existing documents,  
but the NSArrayController won't exist yet since the NIB has not yet  
been loaded.




I tried getting a notification with  
NSManagedObjectContextObjectsDidChangeNotification but this didn't  
seem to work.   I can post the code in case this should have  
worked, but first I wanted to ask if there might be a simpler  
approach?


Thanks,

Philip

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/rashwell%40me.com

This email sent to rashw...@me.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes% 
40utoronto.ca


This email sent to dave.fernan...@utoronto.ca


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iTunes Scripting Bridge examples?

2008-12-29 Thread Scott Anguish

get.. I wasn't using get.. works perfectly now.. thanks!

thanks

scott


On 30-Dec-08, at 12:51 AM, Charles Steinman wrote:

On Mon, Dec 29, 2008 at 9:15 PM, Scott Anguish   
wrote:
Does anyone have any examples of using the Scripting Bridge with  
iTunes?
Specifically how you get the currently selected tracks returned as  
an array

of iTunesTrack items.


Should be something like:

iTunesApplication *iTunes = [SBApplication
applicationWithBundleIdentifier:@"com.apple.iTunes"];
NSArray *tracks = [[iTunes selection] get];

I just did the equivalent in Ruby and it worked like a charm.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Tweaking a window size

2008-12-29 Thread Graham Cox
One of my windows has a delegate implementing the - 
windowWillResize:toSize: method. This forces the window size to be  
certain whole multiples of rows in a matrix of icons, the idea being  
to prevent the user from sizing the window so that only a partial row  
is visible, which is ugly. It works as I wish.


The user can also select whether they want small, medium or large  
icons in this matrix, so the row height changes as a result. When this  
happens I'd like to be able to tweak the window height as minimally as  
necessary to conform to the "whole rows" requirement.


Since the delegate method already does all the needed calculation, I  
figured I could just do something that would cause it to get triggered  
just as if the user had dragged the resize widget. Unfortunately, - 
setFrame:display: is explicitly excluded in the docs - it doesn't call  
the delegate method - , so that's out. So I tried getting the saved  
frame string then setting the frame using the string, but while that  
should call the delegate, it appears not to if the size is the same as  
the window's current size.


Any ideas how I can force the window to act as if it were being resized?

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSColorWell shows no color

2008-12-29 Thread Quincey Morris

On Dec 27, 2008, at 02:13, tobias assmann wrote:

I use some NSColorWell objects in a preference section of my view.  
User can chosse so me colors there. All works fine exept one thing.  
The NSColorWell objects are initialized with default values out of a  
NSColorList when the UI is opened. But the NSColorWell objects show  
the color white. When a NSColorWell is clicked the color that is  
supposed to be selected shows up in the NSColorWell and the default  
selctor as well. It would be nice to see the color, without the need  
to click NSColorWell. I have really no idea what my be wrong. This  
is the code, which I use in the draw method of the view containing  
the NSColorWells:


// Fill the colorWells
[uiBgColorWell setColor:[topv..colors colorWithKey:@"bg"]];
[uiBlinkColorWell setColor:[topv.colors colorWithKey:@"blink"]];
[uiActivBeatColorWell setColor:[topv.colors  
colorWithKey:@"activeBeat"]];
[uiInactiveBeatColorWell setColor:[topv.colors  
colorWithKey:@"inactiveBeat"]];



In the draw method of a view? As in drawRect? That seems like the  
wrong place to do this.


If you're initializing the colors when the view first appears, then  
the view's awakeFromNib method would be the usual place to do it. It  
doesn't seem like you'd want to do this more than once anyway.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Ken Thomases

On Dec 30, 2008, at 12:06 AM, Steve Cronin wrote:

Ken - I don't understand what you said about the method's  
signature's compliance with NSObject _protocol_.
I looked at the protocol definition in the documentation and I just  
don't understand well enough to see what I could do to "side-step"  
the warnings,

Would you be willing to spend another sentence or two on that?


Sure.  Sorry if I was unclear.

First, I only underlined "protocol" to make sure you looked in the  
right place in the documentation.  The -performSelector:... methods  
are documented as part of the NSObject protocol, not the NSObject class.


Second, the documentation for the -performSelector: method says the  
following:


The aSelector argument should identify a method that takes no  
arguments. For methods that return anything other than an object,  
useNSInvocation.


That's saying that the selector you pass to -performSelector: should  
be for a method which takes no arguments and returns an object  
pointer.  This -- the number and types of arguments and return type --  
is the "signature" of the method.


The -performSelector:withObject: and - 
performSelector:withObject:withObject: methods similarly describe the  
signature requirements for the method identified by the selector you  
pass.


So, if you are working with a selector for a method which matches the  
signature required by one of those methods, then you can safely use  
those methods.  Doing so is a way to invoke the method without getting  
the compiler warning that was troubling you.


Cheers,
Ken

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Quincey Morris

On Dec 29, 2008, at 22:06, Steve Cronin wrote:

In the meantime, tweaked your snippet and just added this at the end  
of the header of the class where the -respondsToSelector: issue arose:


//respondsToSelector silencer - see -myMethodName
@interface NSObject (MyClassName)
- (id) foo;
@end

This silences the compiler without any #import being required in  
the .m file AND allows me to document to issue in the header where  
it seems to me it belongs. YAY!! Any downsides to this?


In effect, you're declaring an informal protocol. Why not use a real  
protocol (perhaps one whose methods are all optional) in its own  
header file?


The various classes that implement these methods can #import and adopt  
the protocol (so documenting what's going on).


The method that tests the selectors can use an object of type  
id instead of plain id (so documenting what's going on)  
and the compiler will stop complaining without resorting to trickery.


The advantage of this approach is that you don't have to add  
explanations to your header files. The protocol is self-documenting,  
and describes what's *actually* going on in your design.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSOutlineView

2008-12-29 Thread chaitanya pandit

Hi, Mahaboob,
Did you try calling [outlineView reloadData] in ur launch method?
-Chaitanya

On 30-Dec-08, at 10:33 AM, Mahaboob wrote:

My application uses an NSPopupButton and NSOutlineView. PopupButton  
shows
all the table names in the database and the outlineView displays the  
data in
the corresponding table selected from the popupButton. It is working  
fine. I
also need to display one default table's data in the outlineView  
when I'm
opening this window. So in the opening method of the window I called  
the
same method used for the PopupButton's selection changed, and it  
runs that

method but it doesn't fires the events for the OutlineView. So the
outlineView shows nothing. How can I fires the events for  
outlineView in

this method ?

Thanks in advance
Mahaboob


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/chaitanya%40expersis.com

This email sent to chaita...@expersis.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: respondsToSelector - #import OR compiler warnings?

2008-12-29 Thread Steve Cronin

Ken;

I think I get it now.  In the simple case you describe below, use:

someThing = [myObject performSelector:@selector(myMethod)] instead  
of  someThing = [myObject myMethod]


This seems quite useful!!  performSelector's more ambitious cousins  
seem a tad less 'friendly' but I get the point!


As always with you -> Quite Helpful!
Thanks,
Steve

On Dec 30, 2008, at 1:00 AM, Ken Thomases wrote:


On Dec 30, 2008, at 12:06 AM, Steve Cronin wrote:

Ken - I don't understand what you said about the method's  
signature's compliance with NSObject _protocol_.
I looked at the protocol definition in the documentation and I just  
don't understand well enough to see what I could do to "side-step"  
the warnings,

Would you be willing to spend another sentence or two on that?


Sure.  Sorry if I was unclear.

First, I only underlined "protocol" to make sure you looked in the  
right place in the documentation.  The -performSelector:... methods  
are documented as part of the NSObject protocol, not the NSObject  
class.


Second, the documentation for the -performSelector: method says the  
following:


The aSelector argument should identify a method that takes no  
arguments. For methods that return anything other than an object,  
useNSInvocation.


That's saying that the selector you pass to -performSelector: should  
be for a method which takes no arguments and returns an object  
pointer.  This -- the number and types of arguments and return type  
-- is the "signature" of the method.


The -performSelector:withObject: and - 
performSelector:withObject:withObject: methods similarly describe  
the signature requirements for the method identified by the selector  
you pass.


So, if you are working with a selector for a method which matches  
the signature required by one of those methods, then you can safely  
use those methods.  Doing so is a way to invoke the method without  
getting the compiler warning that was troubling you.


Cheers,
Ken



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com