iphone 如何将数据存储到plist(属性列表文件)中
1:详情见demo
此例子需要解决的一个问题,就是通知事件
name:UIApplicationWillTerminateNotification 根本就没执行啊
UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:app];
iPhone开发基础中第11章例子的这端程序根本没有执行啊!
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:app];
iPhone开发基础中第11章例子的这端程序根本没有执行啊!
该问题的解决办法:
因为UIApplicationWillTerminateNotification 是sdk3.0时候的 home事件 而4.0以后直接点home为 UIApplicationDidEnterBackgroundNotification事件,所以把UIApplicationWillTerminateNotification改为UIApplicationDidEnterBackgroundNotification即可。
具体参考:http://www.buildapp.net/iphone/show.asp?id=2644