Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa methods in Expressions window



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:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.