0

当我在模拟器上 NSLog 我的 Documents 目录时,我看到了文件

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"];

    }

区分大小写已被检查。我的工作假设是 .plist 从 /Documents 目录复制到设备?不 ?我是否需要先初始化一个 .plist ?

我错过了什么......感谢您的帮助。非常感激

4

0 回答 0