开发者

Question concerning dealloc and applicationWillTerminate

开发者 https://www.devze.com 2022-12-14 01:18 出处:网络
I have literally the same problem, as described here http://www.iphonedevsdk.com/forum/iphone-sdk-developmen开发者_如何学JAVAt/968-breakpoints-dealloc.html#post7406

I have literally the same problem, as described here http://www.iphonedevsdk.com/forum/iphone-sdk-developmen开发者_如何学JAVAt/968-breakpoints-dealloc.html#post7406

Sorry for the quote, but the description is perfect.

Because my dealloc is also not called automatically, my question is, am I supposed to overwrite applicationWillFinish and call [self release] in order to not leave any leak?

Kind regards


you don't need to worry about 'cleaning up' memory when your app quits; the OS will nuke your address space from orbit (it's the only way to be sure). If you have non-memory-related cleanup to do (perhaps save temp info to a file), that should go in applicationWillTerminate:. No need to call [self release].


Maybe iPhone OS just doesn't bother with calling dealloc because your app is going to terminate anyway? Any cleanup code should go in applicationWillTerminate, and you don't need to call [self release];.

0

精彩评论

暂无评论...
验证码 换一张
取 消