Re: Weird Problem, is this an XCode Bug?
Re: Weird Problem, is this an XCode Bug?
- Subject: Re: Weird Problem, is this an XCode Bug?
- From: Dave <email@hidden>
- Date: Thu, 04 Feb 2016 18:37:32 +0000
There are 100’s/1000’s of nodes, would take forever, I’m writing a self-test method now…..
Shame about the debugger in XCode, still at least we have lots of lovely animations to make up for it, thanks Apple.
I’m wondering if the cause of my problems is to do with archiving/unarchiving as I’ve found a problem an array in an unarchived array.
Thanks for lot
All the Best
Dave
> On 4 Feb 2016, at 18:22, Sandor Szatmari <email@hidden> wrote:
>
> 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 <mailto: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 <mailto: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