I\'m writing some data to a plist file but it fails on the device but not in the simulator. I\'m lost, don\'t know where to look for a solution.
This is my code:
This fails on the device because you cannot write to the application's bundle folder, only to the /tmp, Documents, and Cache folders. If users were able to modify the bundle, the digital signature for the app would no longer be valid and no one would be able to reliably obtain your intact app from the App Store and run it.
This works on the simulator, however, because your operating system will let you write to pretty much anywhere in your home folder, including the application bundle folder. OS X functionality is not restricted in the same way iOS's is restricted.
This is part of iOS's sandbox approach to security. The solution is to write to the /tmp, Documents or Cache folder, instead.
Why are you trying to write in resource directory? Have you checked this?