• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dereferencing a pointer in ObjC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Dereferencing a pointer in ObjC?
      • From: Ondra Cada <email@hidden>
    • Re: Dereferencing a pointer in ObjC?
      • From: Chris Hanson <email@hidden>
    • Re: Dereferencing a pointer in ObjC?
      • From: j o a r <email@hidden>
    • Re: Dereferencing a pointer in ObjC?
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Re: Help with NSDictionary!
  • Next by Date: Re: ask about sleep function
  • Previous by thread: Re: detect control key
  • Next by thread: Re: Dereferencing a pointer in ObjC?
  • Index(es):
    • Date
    • Thread