当我在我的模拟器上NSLog我的文档目录时,我看到文件
2013-01-02 17:02:02.398 ForPlayAtl[2113:1a903] docs check (
"biz.plist",
"sched.plist",
"ver.plist",
)
2013-01-02 17:02:02.400 ForPlayAtl[2113:1a903] docs path check /Users/Dude/Library/Application Support/iPhone Simulator/6.0/Applications/
当我在我的设备上做同样的事情时,我得到了
2013-01-02 16:56:01.896 ForPlayAtl[2253:907] docs check (
)
2013-01-02 16:56:01.900 ForPlayAtl[2253:907] docs path check /var/mobile/Applications/A7B36683-C41B-4DF5-A9C3-1FDF0F0DCBDD/Documents
我的功能看起来像这样
-(NSString *) dataFilePath
{
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentDirectory = [path objectAtIndex:0];
return [documentDirectory stringByAppendingPathComponent:@"sched.plist"];
}
已检查区分大小写。我的工作假设是.plists从/ Documents目录复制到设备?不是吗?我是否需要首先初始化.plist?
我错过了什么...感谢您的帮助。非常感谢