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
原文地址:https://www.cnblogs.com/fantasy3588/p/5392641.html