• 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: Weird Problem, is this an XCode Bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird Problem, is this an XCode Bug?


  • Subject: Re: Weird Problem, is this an XCode Bug?
  • From: Sandor Szatmari <email@hidden>
  • Date: Thu, 04 Feb 2016 13:22:07 -0500

I have traversed object hierarchies in the debugger using predicates and KVC in GDB described below. (Last tested in Xcode 4.6.3 compiler Apple LLVM 4.2)

For an array, something like... (typed in mail )
po (NSArray*)[arr filteredArrayUsingPredicate:(NSPredicate*)[NSPredicate predicateWithFormat:@"property == 'find me'"]]

This can be used to isolate/locate what objects are in my graph and what their values are.

I usually have overridden -description and can tweak that for custom debug information.

You can use key paths and other fun stuff to extract data while stopped in the debugger (valueForKey:/valueForKeyPath: using collection operators like @distinctUnionOfObjects...)

It is very picky about requiring you to specify return types though.

I haven't yet figured out how to do this in LLDB.  Creating the predicates on the fly yields a warning about forward declarations.

Sandor Szatmari

> On Feb 4, 2016, at 12:05, Dave <email@hidden> wrote:
>
> Hi Again,
>
> I’m trying to debug a network of interwoven objects. To do all that with “po” will take at least 10 times longer.
>
> The only other way I can think to fix it, it to write a method on the Custom Object subclass that Logs the Properties. Doing it that would would probably take 3 or 4 times as long or I could write a self-test method which I suppose would work with the logging method(s).
>
> I’ve tracked it down a bit more and it seems to happen with Custom Objects that have been unarchived. The Object that is unarchived is LTWNetwork, this contains an array property, the array contains instances of my custom subclass, its at this point that the debugger refuses to show them as custom objects and show @“0 objects”, immediately after the unarchive operation.
>
> Is there something I need to do after unarchiving that resolves the new object as the correct class?
>
> All the Best
> Dave
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Weird Problem, is this an XCode Bug?
      • From: Dave <email@hidden>
References: 
 >Weird Problem, is this an XCode Bug? (From: Dave <email@hidden>)
 >Re: Weird Problem, is this an XCode Bug? (From: "Gary L. Wade" <email@hidden>)
 >Re: Weird Problem, is this an XCode Bug? (From: Dave <email@hidden>)
 >Re: Weird Problem, is this an XCode Bug? (From: "Gary L. Wade" <email@hidden>)
 >Re: Weird Problem, is this an XCode Bug? (From: Dave <email@hidden>)

  • Prev by Date: Re: Protocol extensions returning self
  • Next by Date: Re: Different visualization of NSTableView row in Yosemite and El Capitan
  • Previous by thread: Re: Weird Problem, is this an XCode Bug?
  • Next by thread: Re: Weird Problem, is this an XCode Bug?
  • Index(es):
    • Date
    • Thread