Plist works in simulator but not on device
Asked Answered
A

4

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.

Apetalous answered 7/11, 2009 at 22:40 Comment(3)
More detail. For example, are you having trouble just reading the plist or are you reading it but not getting the data you expected?Tantamount
I didn't realize that I need to accept the answers. I've gone through and done that now.Apetalous
You need to post some code. There's no reason why a plist should work in the simulator but not on the device. You should also do a clean build in case this is simply a matter of Xcode being confused and not copying the plist into your built product.Inessive
A
1

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

Apetalous answered 10/11, 2009 at 14:20 Comment(0)
L
4

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.

Laith answered 5/2, 2010 at 9:24 Comment(0)
P
3

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.

Pemmican answered 18/12, 2009 at 11:10 Comment(0)
A
1

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

Apetalous answered 10/11, 2009 at 14:20 Comment(0)
B
0

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

Bushy answered 10/11, 2009 at 1:15 Comment(1)
Ended up recreating the plist and then rebuilding and all works well now. Thanks for the response.Apetalous

© 2022 - 2024 — McMap. All rights reserved.