iphone SDK:可以在模拟器上将数据写入plist,但不能在设备上做同样的事情?
为什么我可以在模拟器上将信息写入 plist
但不能在真正的 iphone/ipod 设备上执行此操作???
xcode 项目中是否存在放置 .plist 文件的绝对路径???
感谢您的所有回复和答案〜
代码:这就是我如何从文本字段将文本写入plist
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Password" ofType:@"plist"];
NSMutableDictionary *propertyList = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
[propertyList setValue:serialNumber.text forKey:@"serial_number"];
Why I can write information to plist on simulator
But can't do this on real iphone/ipod device ????
Is there exist an absolute path to put a .plist file in xcode project ???
Thanks for all reply and answers ~
code : this how I write text to plist from textfield
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Password" ofType:@"plist"];
NSMutableDictionary *propertyList = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
[propertyList setValue:serialNumber.text forKey:@"serial_number"];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能写入应用程序的沙箱目录。下面的函数将返回您的应用程序的文档文件夹的路径。
You can only write to your application's sandbox directory. Below is a function that will return the path to the Documents folder for you app.