• 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
Re: Cocoa methods in Expressions window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa methods in Expressions window


  • Subject: Re: Cocoa methods in Expressions window
  • From: Timothy Collett <email@hidden>
  • Date: Tue, 16 Oct 2007 13:35:02 -0400

On Oct 16, 2007, at 10:18 AM, Jean-Daniel Dupas wrote:
To obtains the result of an expression in the Expression Window, you have to cast a function/method to its proper return type:
For example (int)getpid() or (NSString *)[myarray objectAtIndex:1]
If you don't know what you array contains, you can always cast it into 'id', but you will only be able to inspect the isa pointer (that enought to know the class name of the returned object).

Huh. That really does work; thanks!

I had looked at the documentation you point to, but I was thrown by the fact that the Expression window says it's "out of scope", rather than something like "unknown variable type"...not exactly the most intuitive error message.

Anyway, thanks a lot!  That will be extremely useful.

Timothy Collett

--

"Nothing takes the taste out of peanut butter quite like unrequited love."
--Charlie Brown


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Cocoa methods in Expressions window (From: Timothy Collett <email@hidden>)
 >Re: Cocoa methods in Expressions window (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Cocoa methods in Expressions window (From: Timothy Collett <email@hidden>)
 >Re: Cocoa methods in Expressions window (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: GCC 3.3 template compile error?
  • Next by Date: Clear all breakpoints
  • Previous by thread: Re: Cocoa methods in Expressions window
  • Next by thread: itunes visualizer sdk
  • Index(es):
    • Date
    • Thread