Re: Tracking down source of [_NSControllerObjectProxy copyWithZone:]… error
Re: Tracking down source of [_NSControllerObjectProxy copyWithZone:]… error
- Subject: Re: Tracking down source of [_NSControllerObjectProxy copyWithZone:]… error
- From: Greg Parker <email@hidden>
- Date: Mon, 21 Sep 2015 14:54:06 -0700
> On Sep 19, 2015, at 8:09 PM, Alex Hall <email@hidden> wrote:
>
> Hey list,
> A binding is driving my app (my actual one, not the test one) and has been for days now--awesome! Amid more refactoring of my code, and adding a second binding which didn't take because of uninitialized properties, I've now started seeing this error in my debug log:
>
> [_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 0x608000000ae0
>
> failed to set (contentViewController) user defined inspected property on (NSWindow): -[_NSControllerObjectProxy copyWithZone:]: unrecognized selector sent to instance 0x608000000ae0
>
> From what I've been reading, this is due to something trying to copy an object that doesn't conform to the NSCopy protocol. Most likely, I have a proxy object somewhere Cocoa expects an instance, and since the proxy can't be copied, this is happening. The problem is, I can't see *where* this is going on. My debug log is showing me this, but my debug navigator is empty. There's no runtime error showing in a source file like there is when the line causing the problem is clear, and since I only have an address for the instance and not a name, I'm at a bit of a loss. What is a good strategy for discovering the source of this problem so I can fix it?
This is probably failing to crash because "unrecognized selector" throws an exception and the exception is being caught and ignored somewhere.
If you can reproduce this yourself, try running with an Exceptions breakpoint set. That should stop in the debugger with the call site in the stack trace. (Breakpoints navigator > "+" button at the bottom > Add Exception Breakpoint)
Another dumb alternative: implement -[_NSControllerObjectProxy copyWithZone:] to call abort() or otherwise halt the process. Then it will stop in the debugger or generate a crash log with a stack trace pointing to the call site.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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