ReadPlist
nsarray *cachepath= nssearchpathfordirectoriesindomains(nscachesdirectory, nsuserdomainmask, yes);
nsstring *cachedir = [cachepath objectatindex:0];
nsstring *filepath = [cachedir stringbyappendingpathcomponent:@"version.plist"];
nsfilemanager *filemanager = [nsfilemanager defaultmanager];
// copy the file from the resourcepath to the documentpath
if (![filemanager fileexistsatpath:filepath]) {
nsstring *databasepathfromapp = [[[nsbundle mainbundle] resourcepath] stringbyappendingpathcomponent:@"version.plist"];
nserror *error;
[filemanager copyitematpath:databasepathfromapp topath:filepath error:&error];
}
nsdictionary *dic=[nsmutabledictionary dictionarywithcontentsoffile:filepath];
上一篇: iOS 中的并行代码