Plist works in the simulator, but not on the device

Is there any reason why the data received from plist will be displayed in the simulator, but not on my test device? Worked all day to make it work, and was excited until I tested it on the device itself. It’s strange.

Thanks.

+4
source share
4 answers

Recreating a plist seems to fix my problem. Now works in the simulator and device.

+1
source

I do not know if this answer will help. If the plist is stored in Resources, the simulator will work correctly. On the device, the plist file will only have read permission, and the data cannot be changed in this file. The job will be to save the plist file when installed in the Application Documents folder, where the file will be granted read and write permissions. Use case: I had a plist usersettings file to change the user view from a table view to view scrolling. Setup must be done in the application. This worked fine on the simulator, but it didn’t work on the device because the default value could not be changed. So I copied the plist file to the documents and was able to do this successfully. the code for copying the file will be the same as in the sqlite example.

+4
source

Know that you have it fixed, but would like to keep track of how this thread is Google’s best hit if you are looking for this problem.

Check the plist file name. The simulator seems to be case insensitive, but there is an iPhone. For example, if you have a file called "Foo.plist", but refer to it as "foo.plist" in your code, it works fine in the simulator, but does not load on the device.

+3
source

Not much information here ... plists usually work well. Have you done Build-> Clean?

0
source

All Articles