码迷,mamicode.com
首页 > 其他好文 > 详细

文件操作

时间:2015-03-12 20:35:32      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

// 1. 导向下载
//    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"要下载的应用在appstore上的网址"]];
//    [[UIApplication sharedApplication] openURL:url];

// 2. 把数据写入属性列表
//获得路径
//NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
//NSString *fullpath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"cityDatalist.plist"];
//NSData * cityDataToWrite = [NSPropertyListSerialization dataWithPropertyList:cityList
//                                                                      format:NSPropertyListXMLFormat_v1_0
//                                                                     options:0
//                                                                       error:NULL];
//[cityDataToWrite writeToFile:fullpath atomically:YES];

//3. 从属性列表读取数据
//NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
//NSString *fullpath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"cityDatalist.plist"];
////取出路径的内容
//NSData *cityData = [NSData dataWithContentsOfFile:fullpath];
//
//    NSMutableArray * cityList = [NSPropertyListSerialization propertyListWithData:cityData
//                                                                          options:NSPropertyListImmutable
//                                                                           format:NULL
//                                                                            error:NULL];
//

文件操作

标签:

原文地址:http://www.cnblogs.com/jzlblog/p/4333299.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!