I have some NSString inside my program. If I did a release I think its finished using, it crashed the program. If I don't release them , it cause memory leakage quite a bit. [string1 autorelease] cause executive bad access.
It giving me all kinds of headache开发者_如何学C.
release and autorelease is both releasing, just at different points in time. So if one crashes, most likely the other one will as well.
You need to get your memory management right. Maybe use NSZombies, and the static analyzer might be a good helper, too. Also, the debugger might stop right away at the object that causes the problems.
I suggest to read the memory management guide: http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html
精彩评论