Re: Dereferencing a pointer in ObjC?
Re: Dereferencing a pointer in ObjC?
- Subject: Re: Dereferencing a pointer in ObjC?
- From: j o a r <email@hidden>
- Date: Mon, 29 Jul 2002 09:44:35 +0200
On Monday, July 29, 2002, at 09:27 , Terry Simons wrote:
Is this bad style? Should I be using some NSString comparison method
instead?
Try:
[[[myRadioMatrix selectedCell] title] isEqualToString: @"Red"];
Also, The above code is basically checking the name of the radio button
in an NSMatrix to see which button is currently selected. Is there a
better way to do such checks? It seems to me that the simplest way
would be to grab the name of the radio button, because that's a known
value to me.
You should probably use tags instead (see "tag / setTag:" in either
NSButton / NSCell). Comparing to the title of the cell would break if
you would ever choose to change the title because of a misspelling, for
a localization, et.c. - it's better to use an identifier that's only an
identifier and not part of the UI.
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.