Re: Assuring KVO compliance.
Re: Assuring KVO compliance.
- Subject: Re: Assuring KVO compliance.
- From: Quincey Morris <email@hidden>
- Date: Tue, 07 Apr 2015 17:09:37 +0000
On Apr 7, 2015, at 09:05 , Alex Zavatone <email@hidden> wrote:
>
> Gremlins, I think.
No, something, but not that.
Enums are a C thing, not even Obj-C. They are, for all intents and purposes, an int of some size and signedness chosen by the compiler. So, the enum part of this is a red herring. The reason that changing the enum definition made a difference is, presumably, that it changed the way things were arranged in memory, and that by chance caused your actual problem to do something harmless instead of harmful.
Your actual error was this:
> delegate.app_idle_state = APP_State_Waiting;
> Thread1: EXC_BAD_ACCESS (code=1,address = 0x003f8f3)
and you were mislead by the word “access” to think this had something to do with accessing the property. Actually, EXC_BAD_ACCESS means an invalid pointer to memory.
You can’t tell which pointer, exactly, without looking at the backtrace to see exactly where execution was at the time of the exception. If it’s in the line of code that assigns the app state, the exception probably means that ‘delegate’ is invalid, not the attempt to change the property.
So, you need to try to make the EXC_BAD_ACCESS happen again, and take a harder look at what’s going on at that point, ideally using the debugger at a breakpoint on the exception. You may have a memory management error relating to the delegate object — delegate object references are often kept unretained, which is prone to errors — or a thread safety issue.
_______________________________________________
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