Re: Cocoa methods in Expressions window
Re: Cocoa methods in Expressions window
- Subject: Re: Cocoa methods in Expressions window
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 16 Oct 2007 16:18:29 +0200
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).
Make sure to have a look at the Xcode user guide page about
Expression Windows.
http://developer.apple.com/documentation/DeveloperTools/Conceptual/
XcodeUserGuide/Contents/Resources/en.lproj/06_04_db_view_info/
chapter_42_section_7.html
Regards
Jean-Daniel Dupas
Le 16 oct. 07 à 15:14, Timothy Collett a écrit :
On Oct 15, 2007, at 2:19 AM, Jean-Daniel Dupas wrote:
When your programm break, you can also open the console and type:
po mydictvar
po myarrayvar
(po stand for print object and works for objective-c instances
and free-bridges CFTypes only)
OK, thanks; that is helpful. I'm not really very savvy on the GDB
commands in general...
But does that mean that you're not *supposed* to be able to get the
results of methods in the Expressions window? Particularly with
much of most Cocoa objects hiding themselves from the expansion
(showing only their "isa" pointer), it's kind of difficult to debug
some situations like this...
Timothy Collett
--
"I have come to believe that the principle difference between
heaven and hell is the company you keep there."
~ Simon Illyan
_______________________________________________
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