你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> ReadPlist

ReadPlist

編輯:IOS開發綜合

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

 

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved