当前位置:编程学习 > wap >>

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 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,