• 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: Alex Zavatone <email@hidden>
  • Date: Thu, 04 Feb 2016 19:22:31 -0500

On Feb 4, 2016, at 9:59 AM, Dave <email@hidden> 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@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


References: 
 >Weird Problem, is this an XCode Bug? (From: Dave <email@hidden>)

  • Prev by Date: Re: How to know if an NSView has pending draws
  • Next by Date: Re: How to know if an NSView has pending draws
  • Previous by thread: Re: Weird Problem, is this an XCode Bug?
  • Next by thread: Location of XCode of Apple Developer Site?
  • Index(es):
    • Date
    • Thread