• 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: 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
  • Follow-Ups:
    • Re: Cocoa methods in Expressions window
      • From: Timothy Collett <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>)

  • Prev by Date: Re: Cocoa methods in Expressions window
  • Next by Date: malloc - double free problem on Leopard
  • Previous by thread: Re: Cocoa methods in Expressions window
  • Next by thread: Re: Cocoa methods in Expressions window
  • Index(es):
    • Date
    • Thread