On Apr 7, 2015, at 09:05 , Alex Zavatone <[email protected]> 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 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