iphone SDK:Can write data to plist on Simulator but can't do same thing at Device?

后端 未结 1 1552
花落未央
花落未央 2020-12-21 08:05

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

相关标签:
1条回答
  • 2020-12-21 08:32

    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.

    - (NSString *)applicationDocumentsDirectory
    {
        return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    }
    
    0 讨论(0)
提交回复
热议问题