当前位置: 移动技术网 > 移动技术>移动开发>IOS > ReadPlist

ReadPlist

2019年05月12日  | 移动技术网移动技术  | 我要评论

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];

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网