tags:

views:

437

answers:

5

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.

A: 

Not much info to go on here... plists typically work well. Have you done a Build->Clean?

Morieris
Ended up recreating the plist and then rebuilding and all works well now. Thanks for the response.
ckc123inDC
A: 

Seems recreating the plist fixed my issue. Works in simulator and device now.

ckc123inDC
A: 

Know you have this fixed, but wanted to follow up as this thread is the top Google hit if you are searching on this problem.

Check the name of the plist file. Seems the simulator is not case sensitive, but the iPhone is. For example if you have a file named "Foo.plist" but reference it as "foo.plist" in your code, it will work fine in the simulator but fail to load on the device.

Chris
A: 

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.

Nareshkumar
A: 

Can I just say this one little post saved me so much grief. When I installed my first app on my device the Table was unpopulated with my data. After reading this post I noticed my plist was Data instead of data - the capital letter killed it. A huge thanks to all that worked this out - maybe apple should put this error in the simulator and flag it up? Happy building!

FreddieSkoda