iphone - Settings.plist iOS -
i have settings.plist file in ios application. access using code below:
nserror *error; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"settings.plist"]; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if (![filemanager fileexistsatpath: path]) { nsstring *bundle = [[nsbundle mainbundle] pathforresource:@"settings" oftype:@"plist"]; [filemanager copyitematpath:bundle topath: path error:&error]; } nsmutabledictionary *savedstock = [[nsmutabledictionary alloc] initwithcontentsoffile: path]; but, make changes settings.plist file in application, add row. if publish it, users have app have out dated settings.plist file. ideas on workaround or anything? have tried accessing settings.plist file straight nsstring *bundle, values don't "save".
you need file modification date check, see my answer here. if modification date later last checked date, download settings.plist file , replace in users app.
Comments
Post a Comment