I get the following error in xcode.
error for object 0x4e18d00: pointer freed; ** set breakpoint in malloc_error_break for debugging
I set NSZombieEnabled to target so that I can view the call.
- [___ NSArrayI release]
It looks like I released some array somewhere else in my code, and then the auto-release pool tries to free it even when it is already disabled.
How to find out where? Any idea?
FYI, I create all my arrays using the arrayWithCapacity method or something similar, never use the alloc or init methods. I don't see anywhere where I release the same arrays. (maybe I'm blind !!)
In addition, the control flow is as follows: I press the UIButton button, start the function attached to onclick. This will go to various logical levels and then return NSArray back. Then I can iterate over this array into the "onClick button" function and print the contents. When this "onClick button" function completes, I get the above error in the "main" method.
One more note: in one function, I create an NSMutableArray, but want to return an NSArray , so I use [[mutableArray copy] autorelease] . This is normal, right?
We will be very grateful for any advice, as I often have great difficulty trying to track the cause of errors.
Thanks in advance.
conor source share