Dereferencing a pointer in ObjC?
Dereferencing a pointer in ObjC?
- Subject: Dereferencing a pointer in ObjC?
- From: Terry Simons <email@hidden>
- Date: Mon, 29 Jul 2002 01:27:34 -0600
Hi,
This may be a really stupid question, but how do I dereference a pointer
in ObjectiveC?
I have the following code:
if(@"Red" == [[myRadioMatrix selectedCell] title])
{
//do something
}
Now... I can't do this because @"Red" is an NSString, but
[[myRadioMatrix selectedCell] title] is an NSString *.
I'm used to dereferencing stuff in C/C++, but I don't recall reading
anything about it thus far in any of the documentation I've read.
Is this bad style? Should I be using some NSString comparison method
instead?
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.
Thanks,
- Terry
_______________________________________________
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.