simple array release error question
simple array release error question
- Subject: simple array release error question
- From: Ben Dougall <email@hidden>
- Date: Sun, 1 Jun 2003 00:18:57 +0100
why is the first version here fine, and the second version not?
for(i = 0; i < 10; i++) {
...
[array addObject: entry];
}
...
[array removeAllObjects];
[array release]; // no errors
___________________
for(i = 0; i < 10; i++) {
...
[array addObject: entry];
}
...
for(i = 9; i >= 0; i--)
[[array objectAtIndex:i] release];
[array release]; // this line gives this error: signal 11 (SIGSEGV)
array doesn't seem to exist when [array release] is called in the
second one. why is it different to the first version?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.