简体   繁体   中英

Simulator and device give different results

Have any of you ever ran into issues where the changes you've made are only being reflected on the simulator and not on the device?

Example, if i want to set the selected background image view for a table cell, the selection state in the simulator will show the changes but not on the device during testing.

This inconsistency is starting to worry me because when it's time to deploy to production, how do i know that the apps in the app store will work correctly?

Thanks

Have any of you ever ran into issues where the changes you've made are only being reflected on the simulator and not on the device?

Yes, this has happened to me many times.

This inconsistency is starting to worry me because when it's time to deploy to production, how do i know that the apps in the app store will work correctly?

When I first started developing for iPhone, I once had to rewrite a significant portion of code because while it worked perfectly in the Simulator, it did not work properly on the iPhone. I realized then that the Simulator is not an Emulator, that is, it does not replicate an iPhone exactly.

You need to test on an iOS device frequently to ensure that your code is working properly. That is what the App Store reviewers will be using and what your users will be using, not the Simulator.

During your daily development, you can use the Simulator and also your fastest device, like the 5th gen iPod Touch and iPhone 5. Periodically and towards the end of your development, it is good to test on older, slower, more memory limited devices, especially the oldest available that will run the iOS version that you are targeting.

The best thing you can do when this happens is to uninstall the app your're developing, (extra measure) restart the device to clean any app caches, and finally do a clean build from XCode. Things like this tend to happen to me frequently and uninstalling my app followed by a clean build seems to do the trick all the time.

Inconsistencies happen, that's why you need to test on actual devices (and why it's a simulator, not an emulator). In this case, it's most likely being caused by XCode failing to properly update the program, in particular the nibs. Delete your app from the phone and reinstall it fresh. The app store and iTunes use a different method of installation, so you shouldn't have to worry about it in the store.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM