I am stuck with a very strange issue. I hope that many of you can provide me input to solve this. My application breaks quite often, but I am not able to get the exact scena
The error "modifying layer that is being finalized"
occurs when you are trying to modify the properties of a CALayer when it is in the process of being deallocated. I've seen this happen when I've accidentally used an accessor to clear a property on a CALayer while within that layer's -dealloc
method.
This may also happen within a UIView's -dealloc
method if anything display-related is updated (thus touching the underlying CALayer).
In your case, it looks like you're overreleasing a UIView somewhere, due to the zombie message. The "modifying layer that is being finalized"
is just a side-effect of that, because at some point you'd be updating the UIView while it's being deallocated before it should.
Turn on breakpoints, make sure you've set a breakpoint on exceptions being thrown, and run your application within the debugger. It should halt on the line where a message is being sent to an overreleased UIView, which should tell you what view is at the center of this. Then you can backtrack to find at what point you're sending one too many release messages (or have autoreleased without retaining if you need it beyond the current scope).
Because you already have evidence pointing to the UINavigationBar, check it and its associated views to make sure that you're properly retaining it.
@MegaMind- I was also stuck with this issue "modifying layer that is being finalized" that cause app quit but i am able to solve this issue. I think you are releasing any object that is being called when UIView is appeared.
I got this error when I released an object that never had alloc called on it, so that could be it.
To help out noobs (like me) who cant see anything wrong with their mem. mgmt,
I also got this error because i wrongly used an 'assign' on an IBOutlet property that was supposed to have an 'retain' on it. Be careful when you copy-paste!
Got this error when i clicked on a UIButton. The funny thing there was nothing wrong with the UIbutton , but actually on one of subviews below the button. I found a subview that had and extra release on it.
I got this error when accidentally trying to release an object that should not have been released, in conjunction with using it for a UIView animation block. Fixing that made the problem go away.