Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plist works in simulator but not on device

Tags:

iphone

sdk

plist

Is there any reason that data pulled in from a plist will show in the simulator but not on my test device? Worked all day on making it work and was thrilled until I tested it on the actual device. Strange.

Thanks.

like image 247
ckc123inDC Avatar asked Mar 01 '23 02:03

ckc123inDC


1 Answers

I dont know if this answer is going to help. If the plist is stored in the Resources, the simulator will work properly. On the device, the plist file will be given only a read permission and data cannot be modified in this file. A work around will be to save the plist file upon installation into the Application documents folder where the file will be given read and write permissions. Test case: I had a usersettings plist file to change the view of a user from a table view to scroll view. The setting needed be done in the application. This was working fine on simulator but on device, it was not working because the default value was not able to be modified. So i copied the plist file to documents and was able to do it successfully. code for copying file will be the same as you see in sqlite example.

like image 185
Nareshkumar Avatar answered Mar 12 '23 15:03

Nareshkumar