Q: My application saves data to the application's bundle, which works fine in the iPhone Simulator. However, when I run on a device, my data cannot be saved. What's going on?
A: The different behaviors you are seeing are due to differences between the iPhone Simulator and the actual device. In the simulator, your application bundle is saved in a location that allows you full read/write access, so your code succeeds in writing and saving the preference data to the bundle. However, on the device, your application bundle cannot be modified. The File System Programming Guide contains information on the writeable locations in your application directory.
Your iPhone application's home directory contains a subdirectory for preferences (<Application_Home>/Library/Preferences). However, you should not create preferences files directly, but should instead use the NSUserDefaults or CFPreferences to get and set application preferences.
Alternately, you can save application specific data to the <Application_Home>/Documents subdirectory of your application's home directory. Use the NSFileManager URLsForDirectory:inDomains: method to get a URL to this directory.
Both of the above techniques also have the additional advantage that they will preserve the users data when the application is updated.
- 浏览: 45582 次
- 性别:
- 来自: 河南
相关推荐
IBM Rational Data and Application Modeling Bundle 方便地将两种类型的工具打包到一种产品中,为负责开发数据和应用程序的开发人员提供了一种获取所需架构功能的简便方法,全部基于 Eclipse 并具有与 IBM Rational...
Data Analytics: Practical Data Analysis and Statistical Guide to Transform and Evolve Any Business, Leveraging the power of Data Analytics, Data Science, and Predictive Analytics for Beginners ...
Data Analytics: Practical Data Analysis and Statistical Guide to Transform and Evolve Any Business, Leveraging the power of Data Analytics, Data Science, and Predictive Analytics for Beginners ...
An application that demonstrates how to create a live wallpaper and bundle it in an application that users can install on their devices. Lunar Lander A classic Lunar Lander game. Multiple ...
I have decided to put the key to unlock removal features on any device on the market. It should be listed under package com.treve.loggingkey Its called Logging TestApp Pro Key. Just install the apk ...
It is important to select the appropriate architecture to ensure compatibility with the device on which the app will run. ##### DYLIB_COMPATIBILITY_VERSION (Compatibility Version) This setting ...
Verify code transparency inside an Android App Bundle, APK files or an application installed on a connected device. Read more about the App Bundle format and Bundletool's usage at g.co/androidapp...
Scala is especially good for analyzing large sets of data as the scale of the task doesn't have any significant impact on performance. Scala's powerful functional libraries can interact with databases...
the on-disk index file, breaking t7519 tests occasionally, which has been corrected. * Update to Unicode 12.1 width table. * The command line to invoke a "git cat-file" command from inside "git...
user can view non-drm ebook on iPad, NOOK, Sony Reader or other device without limitation, convert ebook to pdf/doc format in Calibre to print and share ebook with friends. Key Features - Drag Drop ...
Set up the wx main frame by adding your own Frame class to the application Create two stage widgets by using a three step process Set up an event handler, customize, receive and handle events by ...
This letter introduces an efficient bundle adjustment (BA) method based on the sparse Broyden-Fletcher-Goldfarb-Shanno (sparse BFGS, sBFGS) solution, which efficiently estimates camera poses and 3-D ...
With Early Release ebooks, you get books in their earliest form—the author's raw and unedited content as he or she writes—so you can take advantage of these technologies long before the official ...
现在,我们可以在任何Activity、Service等组件中通过`MyApplication.getInstance().getSharedData()`来获取共享数据,或者通过`MyApplication.getInstance().setSharedData(data)`来设置共享数据。例如,在一个...
Save at least 25% when you bundle! PoolManager, the original and best instance pooling solution for Unity, manages instances more efficiently to increase performance, organize the scene hierachy and...