I had an error in the Debugging Window telling me there was a double release....
malloc: *** error for object 0x1346f90: double free
*** set a breakpoint in malloc_error_break to debug
where to put what breakpoint?
in gdb? well somehow this didn't work for me.
The problem is of course the object is released later on, not stopping at the line which caused the problem....
these links helped me setting the environmental variables needed to debug:
http://lists.apple.com/archives/Xcode-users/2008/Apr/msg00160.html
http://www.cocoadev.com/index.pl?DebuggingAutorelease
http://www.cocoadev.com/index.pl?MallocStackLogging
http://www.cocoadev.com/index.pl?NSZombieEnabled
http://www.cocoadev.com/index.pl?DebuggingTechniques
after setting the environmental variables given in the link I got this error:
*** -[CFArray release]: message sent to deallocated instance 0x135e0a0
which didn't tell me anything new, the instance number I could not trace...
the debugger told me this:
malloc: stack logs being written into /tmp/stack-logs.373.Grungegolf.KT6xux
but where is this file situated?
this command didn't help because the pin number (in this example 3939) from this example is not in my gdb error
shell malloc_history 3939 0xa4e10this didn't help either:
gdb: t a a bt
in the end I searched for all the release commands I have given with the only clue that is must be an Array, and I found the culprit...
trying to understand:
I loaded a textfile:
NSString *myText = [NSString stringWithContentsOfFile:whateverFilePathString];
I used this to load my game fields, being all in the textFile, a String
so seperate the fields:
NSArray *allData = [myText componentsSeparatedByString:@"***"];
with the separator "***"
then taking element 3 which contained the bouncers...
NSArray *bouncerData = [[allData objectAtIndex:2] componentsSeparatedByString:@","];
putting the bouncer data, making them numbers in another array of objects...
I released the bouncerData (wrong!)
I suppose this bouncerData array is released with the allData array, which is also released automatically....