Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-18-2011, 02:29 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2009
Posts: 87
IronMike is on a distinguished road
Default App Store 'Update' overwrite plist?

I have seen a bunch of similar questions but I want to make sure that my exact question is answered.

I'm about to release an app that uses 4 plist files that are stored on the device like so:

Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];	
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"myFile.plist"];	
BOOL success = [fileManager fileExistsAtPath:filePath];

if (!success) {		
   NSString *path = [[NSBundle mainBundle] pathForResource:@"myFile" ofType:@"plist"];
   success = [fileManager copyItemAtPath:path toPath:filePath error:&error];
}
In the future if I make changes to the app, I do not want to overwrite these files. Users will be very mad if they lose all the settings in the files. Since the files are in the documents directory, I am guessing that the files would not be overwritten on an update. Also, when I delete the app in the simulator and reinstall, all the plist files are still in tact. I must "Reset Content and Settings..." for the plist files to be cleared out.

So am I correct that if I release an update in the future, it will retain my plist files?
IronMike is offline   Reply With Quote
Old 01-18-2011, 03:08 PM   #2 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

An update will not change any files in the documents directory.

But if the user deletes the app, the documents directory is also deleted. But they might be able to restore from an iTunes backup.
JasonR is offline   Reply With Quote
Reply

Bookmarks

Tags
documents directory, plist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 366
13 members and 353 guests
7twenty7, blueorb, dre, iAppDeveloper, jeroenkeij, Mah6447, Morrisone, mottdog, sacha1996, Sami Gh, stanny, toon4413, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:40 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0