[iPhone] Store Application Data

I am need to store some application data locally on the iphone. The data, periodically, will get updated from a server (web service). The user will not be able to change the data. There is some Parent/Child relationship on the data but not very complicated (for example a Contact, has multiple addresses and multiple phone numbers). One of the requirements is to be able retrieve all addresses for a specific contact (using the example above).
What is the recommended storage facility to store the data? Can I do this using a .plist and replace the whole file from the server? or is it better to use sqllite and do insert and update commands to update the data? Any other suggestion?
Thanks

NSDictionary is designed to read and write plists, so I think it's the natural choice unless you're talking about so much data that you'd begin to see a performance problem without an index. At that point you'd want to consider sqllite. I can't tell you where the cross over might be, but an index generally isn't worth the overhead until it takes more than 10,000 comparisons to find something.
A NSDictionary solution is really easy to code, so try that first and see if you have any performance or memory problem. If you're no where close to 10,000 records, I think you'll be happy with it. If you're planning for a million records it might be another story.
The problem with replacing the entire file from a server is that the plist format isn't very robust. Although the syntax is very simple, one error can make the entire file unreadable. Therefore you'd really need to trust the server. At the very least I would make a temp.plist and see if NSDictionary can read it before committing to it.

Similar Messages

  • The beset way to store application data?

    I am wondering where is the best place to store the data that is accessed by my cocoa based application?
    for example, my program needs to save passwords, and email accounts in some file and then retrive these info from this program later.
    I am looking at "local domain" - application/utility
    is that right?
    also, I am using NSFileHandle to do the file I/O, is that the right way to achieve such tasks?
    how can I obtain the path of "local domain"? thank you.
    Power G5 Quad   Mac OS X (10.4.3)  

    save small amounts of user specific data to
    ~/Library/Preferences/com.mycompany.settings
    and system wide data to
    /Library/Preferences/com.mycompany.settings
    you also might want to look at the
    NSDictionary -writeToFile:atomically: method.

  • Migration from PC to Mac without losing application data (savegames etc.)

    Hello everyone,
    I am migrating from from my old Windows PC onto a MacBook Pro, and I'm having difficulties with iTunes and my iOS devices (iPhone 4, iPad 1). Maybe someone here can help me out, I'd be ever so grateful.
    I set up iTunes on my MBP yesterday and logged in to my account. I replaced the empty iTunes Media folder with my old one (which contains all my music, videos and applications) via an external hard drive.
    First problem: it wouldn't import these files into my new library automatically. Just showed me an empty library I think I imported the entire iTunes Media folder manually yesterday via "Add to folder". The status right now (after some experimentation) is old iTunes Media folder copied, but nothing imported (that is, I have an empty library).
    When I connected my iPhone and tried to synch, I first had to authorize the MacBook for the iPhone. So far, so good. However when I tried to synch iTunes warned me that if I synch, all data on the iPhone will be removed and replaced by the data from my new local library (which is, of couse a copy of my old library, but doesn't store application data like savegames).
    I tried to do it via "transfer purchased items from iPhone", which took forever, but yielded the same result: a warning that all data on the iPhone would be erased.
    So the question is: How do I connect my iPhone and iPad to iTunes on my new Mac without losing application data like settings and savegames? And why is this so complicated and intransparent? I should be able to just copy my media, say "authorize this Computer, then add iPhone to the registered devices" and then proceed like nothing ever changed.
    I searched the net until three in the morning yesterday, but couldn't find anything that sounded safe enough to give it a try.
    Thanks in advance and best Regards,
    Nate
    PS: I do have the backup-folders from my old PC on a USB stick - are those going to help?
    Message was edited by: Nathan1980 (Correction)
    Message was edited by: Nathan1980

    I was fighting this battle the past few days myself; but actually it is REALLY easy now. See here:
    http://www.macworld.com/article/146958/2010/03/moveitunes_windowsmac.html
    Then, once iTunes was on the Mac, I did this:
    1. On the Mac rename ...\iTunes\iTunes Library.itl as ...\iTunes\iTunes Library
    2. On the Mac delete ...\iTunes\iTunes Library Genius.itdb (Apparently the PC & Mac versions are not compatible - iTunes will just rebuild it later)
    3. Launch iTunes and immediately press & hold down the Option key until a dialog opens asking you to Choose a library. Navigate to the folder/drive you've copied from the PC and open ...\iTunes\iTunes Library.
    (thanks to turingtest2 for the above steps)
    That was it. Did it yesterday evening. All playlists, libraries, everything copied fine. No problems; no broken links. Perfect.

  • Storing Application Data - Cross Platform

    Dear All,
    I have a question regarding the suitable location to store the data/files generated by my application. Here are some of the possibilities I found, but they doesn't seem to be suitable:
    1. I can store the files under the application folder (where the application is installed) in C:/ProgramFiles using System.getProperty("user.dir"). This option seems to work fine with most of the OS. However this is not suitable for windows vista as I am unable to modify the files (because of virtual store).
    2. I can store files under the user home directory (ex: C:\Users\user1) using ystem.getProperty("user.home"). This is not a good solution because I want my files to be accessed by all the users of the system.
    3. Using System.getenv("ALLUSERSPROFILE") i can store files in a location which is accessible to all the users i.e. C:\ProgramData. However this doesn't seem to work in Linux, as it is returning null.
    So what is the best location to store application data, which is accessible to all the users of the system?
    Thanks in advance

    Thank u piet....
    By data i mean projects and their respective files (xml) created using the application. So Preferences API won't be suitable to store.
    Allowing user to select the location where he/she wants to store the application data is not viable. For example, if the user chooses c:/programfiles then the problem with vista virtual store will arise, or if the user chooses user's home directory C:\Users\user1, then other users can't access the application data.

  • I am using Iphone 4S and Ipad 2...it seems that my App Store application is missing or deleted. How can i retrieve it? How do I download a new one. My software is up to date. Please help

    I am using Iphone 4S and Ipad 2...it seems that my App Store application is missing or deleted. How can i retrieve it? How do I download a new one. My software is up to date. Please help asap. Thank you.

    Check: Settings - General - Restrictions - Installing Apps = ???

  • My iPhone 4s app store application says I have 12 updates, when I attempt to update it says can't connect to iTunes store, I plugged it into the computer the other day but it hasn't helped. What can I do?

    My iPhone 4s app store application says I have 12 updates, when I attempt to update it says can't connect to iTunes store, I plugged it into the computer the other day but it hasn't helped. What can I do?

    Make sure you have cellular data connection Settings > General > Network > Cellular Data

  • How to transfer application data from iphone

    Hi,
    I've recently had to reload my windows PC meaning that I've a brand new itunes installation. I've just downloaded a satnav app I'd like to sync to my iphone.
    The problem is that there are loads of apps on my iphone and if I click the box to sync the iphone with itunes it says that all existing applications and their data will be replaced on my iphone. I have transfered the purchases so I should get all the apps back but I don't want to lose the data.
    Is there any way I can backup the data in these apps or selectively sync the satnav app?
    Cheers
    -Al

    If you included your iTunes library with your computer's backup before reloading Windows (the iTunes named folder which stores all iTunes data) and placed the iTunes folder in the designated location - the same location before reloading Windows, you would not have to re-install all iTunes content including 3rd party apps.
    You can't selectively install the satnav app from iTunes on your computer without all iTunes content on your iPhone being erased first, but you can download and install the app with your iPhone.
    Application settings and data created and stored by a 3rd party app is included with your iPhone's backup.
    With your iPhone connected to iTunes, control-click on your iPhone in the iTunes source list and at the menu window that appears, select Back Up.
    After all iTunes content on your iPhone is erased when syncing and the 3rd party apps are re-installed, if 3rd party app settings and data created and stored by a 3rd party app is lost in the process, and I think it will be, you can follow this by restoring your iPhone with iTunes from your iPhone's backup. After the backup for your iPhone is restored, this must be followed by a sync to re-transfer your selected iTunes content including 3rd party apps. The 3rd party app settings and data created and stored by a 3rd party app will be restored with your iPhone's backup.

  • Hello, I want to restore a backup on my Iphone 4S, but in i-tunes it's not vissable. When I'll look on te pc: (username)\Application Data\Apple Computer\MobileSync\Backup\ it's there! How can I get this backup to my iphone or itunes? Thanks in advance!

    Hello, I want to restore a backup from this afternoobut in i-tunes it is not visseble. When I'll look on te pc: (username)\Application Data\Apple Computer\MobileSync\Backup\ it's there! How can I get this backup to my iphone or itunes? Thanks in advance!

    Follow the steps in this article to restore from iTunes back up:
    http://support.apple.com/kb/HT1766
    Since you say you cant see the back up in iTunes you should be able to see it when following the last step where it says for iTunes 10.7 or earlier. Dont worry as this step also works for iTunes 11.

  • How to back up saved application data when moving to new iPhone?

    So I've done a fairly extensive search on google trying to figure out how to backup not just my apps, but the saved data within them as well. Most of the stuff I'm finding requires jailbreaking or many steps. I'm coming here to post to see if there is an 'easy' way to do this by now..
    I mean you back up your old iPhone through iTunes but from what I'm hearing that does not save the application data? I don't understand how this was not put in, especially considering how the iPhone is made to look like such a great portable gaming device, in which many save your progress along the way..
    For example, I have peggle on my iPhone 3G and have been playing it a little bit here and there for a little more than a year and have 100% completed on most levels. I don't want to lose all that, you know?
    So anyways, is there any simple way to do this yet? If not, what's the simplest way to go about doing this?
    Thanks!

    Thank you for responding... I wonder then why so many posts are regarding this online...
    So all I need to do is back up my 3G iPhone in iTunes, and then just restore from backup with the iPhone 4 and all my saved data and stuff will remain? Cool!

  • My iPhone was connected to my old laptop but that laptop is broken now i want to connect it to a new laptop but when i do that do i also lose all the application data?

    Hello,
    just to explain quikly how my situation is I bought an IPhone and connected it to my regular computer, a few weeks after that i bought an macbook because my old computer was having problems with all kinds of things. recently my old computer "died" and now i cant add any music to my IPhone unless i connect it to my macbook but it's saying it will delete everything on the IPhone and use this library but does it also delete all the application data? for a quik example. Angry birds do you lose your progress on it?
    thank you for helping, Blackhounter

    If you are saying that you didn't back up your old computer ever, especially when you knew it was failing, then you are out of luck; you cannot restore a backup that doesn't exist. However, you can probably save some of your content from the iPhone as follows:
    Connect your iPhone to your new computer, but do not sync
    Authorize iTunes on the new computer to your iTunes account
    Go to the iTunes File menu and choose "Transfer purchases"
    Click on the phone's name in iTunes and then click on the Info tab on the right
    Set up apps on your computer to sync contact, notes and calendar to
    Make sure there is at least one of each in the apps you have selected
    Sync
    You will still lose any non-iTunes music and videos, and any photos in the photo album (but you will not lose the camera roll).

  • How to store custom application data in the Portal

    Hello,
    Is there a mechanism in the Portal whereby you can put custom application data into persistence and then retrieve it again? I don't want to use the database to store the data. I was hoping there is some API to such a mechanism that will allow you to do this.
    Of course, I also mean that I want to persist the data beyond the lifetime of a session - i.e. when the user logs off and comes back later, I want to retrieve the data again. Also, I do not want to use a KM repository, because I do not want to make the application KM-dependent.
    Any suggestions would be welcome.
    Thanks,
    Martin
    Message was edited by: Martin Ceronio

    Martin,
    do you want to store this data on a per-user basis? Then the personalization functionality might be want you want. You could define some additional properties in the portalapp.xml for your component and set its personalization to "no-dialog".
    Alternatively, you could store this information as additional attributes of the IUser object. See the following code snippet for details:
    IUserMaint mutableUser = UMFactory.getUserFactory().getMutableUser(userName);
    mutableUser.setAttribute(NAMESPACE, ATTRIBUTE, "some user-specific data");
    mutableUser.save();
    (NAMESPACE, ATTRIBUTE being some custom defined String constants that uniquely identify the attribute.
    Repost if you need further details.
    Regards,
    Dominik

  • HT5624 how to get back my "AAp store" application on Iphone 4....

    how to get back my "AAp store" application on Iphone 4....

    The App store app is a built in app and cannot be deleted. Try:
    Check settings to see if restrictions are turned on and/or if Installing apps is turned off (Settings app > General > Restrictions)
    Check all of your home screen (by swiping left to right), and folders to see if was inserted into one. (you can also use Spotlight search which will tell you if it is in a folder. Swipe down on the Home screen and type in "app Store")

  • My app store application on my iPhone 4S is not accepting my password for one of my Apple ids. I have a feeling it is because the ID isn't correct, it should be my email address and it is not just 1st portion.

    My app store application on my IPhone 4S is not accepting my Apple ID and password. The ID comes up, but I don't think it is totally correct as it doesn't have the complete email address which is actually my ID. I know the password is correct because I just changed it even though I knew what my last one was, I changed to be extra sure. I am not sure how to change the ID in the App Store application.

    To change the ID:
    Settings > Store > Apple ID. Sign Out of the old and in with the new.

  • Apps store application disappeared from iPhone

    Hi, I've lost App store application in my iPhone after it was upgraded iOS 4.1. In addition, apps sync is not allowed in iTunes, I mean can not be checked. How can I the app store application and from where? Which software might cause the failure: iOS or iTunes? Should I make a back up from iTunes? Can be repair the sync function?
    I have an iPad also, but I don't dare to sync it now.
    Many thanks for help in advance.

    Hi wjosten,
    It worked! You pointed out exactly the solving of my problem. I forgot that I set some restrictions.
    Since I disable to apps download function, it caused that the Apps store icon vanished from the screen.
    After I had enabled this function again, the icon appeared on the screen.
    Thank you again!
    cheers

  • IPhone Application Data

    I have searched the forums and haven't found an answer so I decided to post this.
    When I back up in iTunes, is the information on my phone backed up? By all I mean the application data: the levels on my games, the assignments in my homework app, the palettes in my color app, the settings to all my apps, the downloaded books in my eReader app, my history in Safari, my bookmarks, etc.
    If not, is there such an app out there that would essentialy create a disk image of my phone?

    Yes, mostly. Backup information includes information such as mail settings, text messages, notes, call history, contact favorites, sound settings, widget settings, certain network settings, and other preferences including settings and data from third-party applications purchased from the App Store.
    Read more here: http://support.apple.com/kb/HT1766

Maybe you are looking for

  • Best System Diagnostic, Optimisation & Repair Tool/App For Noobs & Novices?

    The one thing that frustrates the **** out of me is that for noobs like me, when something goes wrong on ones Mac - it is a absolute nightmare trying to figure out how to fix it or get rid of the problem without being a rocket scientist on mac archit

  • IMac G5 with Built-In iSight - System Freezes

    Hi, I have the new model iMac G5 that is now consistantly freezing. When I say freezing, I get the spinning wheel and nothing is accessable. I have to hold down the power button to reset it. I have called Apple and reset NVRAM, clear the cache's, etc

  • Is the trial version reflective of the real application?

    I have downlaoded the trail version and find that the application is VERY SLOW at undertaking commands and not in the same league as the speed of Excel for Mac. Is the poor response time I am experiencing (major) because I am don't have an Intel proc

  • Futur of java

    hi i just start to sue java, i study it at school, and i do my "stage" (dont know how to say it in english) in java, i really like it, and i want to do my certification when i'll be better then now. But at your opinion dows java seem to be grown, sta

  • Outlook does not display in the syncronize part Desktop software.

    I'm running Windows 7, and Outlook 2003 (SP3). I have a BB Tour. I've installed Desktop version 5.0.1.28. No problem with the instillation or any or feature. However w hen I go to the syncronization and click on the box in front of Calendar (or any o