On Feb 4, 2016, at 9:59 AM, Dave <[email protected]> wrote:

> XCode 7.2 (7C68).
> Mac OS X (not iOS).
> 
> Hi,
> 
> I sent the following message to the XCode List, but now I’m wondering if 
> there is a bug in my code that is causing this weird behaviour? What could 
> cause then Debugger to think that a regular object is an Array/Dictionary? 
> 
> The object in question is subclass from a custom base class. Apart from 
> being, NSCopying and NSCoding complaint there isn’t really anything strange 
> about it.
> 
> I’m trying to debug an App. I have a regular object that contains NSString's, 
> NSArray’s and NSDictionary’s.

First of all, they are NSStrings, NSArrays and NSDictionaries. You don’t use an 
apostrophe on a plural.  You’ll cause a fault in our brains’ English compilers.

> I have a method that does an alloc/init to get a new one, but after the init 
> call, the debugger shows the Object as LTWNodeInfo @“0 objects”  as if its an 
> array and if I try to inspect it, it won’t show be any of the properties. If 
> I print it to the log is says its the right class.
> 
> What could someone tell me why this is happening and how to fix it?
> 

Whenever the debugger appears to be barfing, I use a method I call autoDescribe 
that is a category on NSObject.

It goes through each object that you pass to it and walks into objects and 
dumps their properties, the name of the property and its value.

It’s not bulletproof and when an object contains a struct or some more 
foundation item, it might bail on you, but for all the objects that are build 
off of NSObject, it recurses through the object and spits out the items it 
finds.

If you have custom classes with properties that are NSStrings, it’s a stupid 
easy way to get a print out of the object’s internals.  

I’m not sure what the internal structure of your LTWNodeInfo is, but I’ll be 
happy to send this over if you think you’d find it useful.

There are other projects out there in the wild that appear to be called the 
same thing.  I’m not sure if they work better or worse than mine, but here’s 
one that looks useful and easy to try out.

https://github.com/neoneye/autodescribe

Good luck.

> I’m trying to get something finished for tomorrow and I can’t debug my code. 
> I’ve tried Cleaning the Build Folder, Cleaning the Project, Restarting XCode, 
> 
> Thanks in advance
> Dave
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
> 
> This email sent to [email protected]


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to