plist file not being found

后端 未结 2 702
忘掉有多难
忘掉有多难 2021-01-28 06:11

I\'m trying to write a simple array to a plist file and then later on retrieve it. I have the following code:

+ (NSString*) dataFilePath
{
    NSArray *paths = N         


        
相关标签:
2条回答
  • 2021-01-28 06:56

    Do you really want to write in NSDocumentationDirectory directory? I think, this directory is not created by default (so you must make it before).

    Perhaps you wanted NSDocumentDirectory. I tried it and your code works.

    0 讨论(0)
  • 2021-01-28 06:59

    Again, Xcode's stupid autocomplete made you lost: NSDocumentationDirectory should really be NSDocumentDirectory.

    The Documentation directory doesn't exist on iOS, so you can't write there.

    0 讨论(0)
提交回复
热议问题