zoukankan      html  css  js  c++  java
  • JSON 保存到本地

        NSArray *array = [NSJSONSerialization JSONObjectWithData:[NSData data] options:NSJSONReadingAllowFragments error:nil];

        NSArray *docs = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);

        NSString *path = [docs[0] stringByAppendingPathComponent:@"json.plist"];

        [array writeToFile:path atomically:YES];

    红色[NSData data]是从网络来的数据 

    1
  • 相关阅读:
    2
    1
    java10
    java8
    java9
    java7
    java6
    java5
    java4
    java3
  • 原文地址:https://www.cnblogs.com/fantasy3588/p/5392641.html
Copyright © 2011-2022 走看看