zoukankan      html  css  js  c++  java
  • 文件操作

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

  • 相关阅读:
    骑行的乐趣
    亲子运动会
    【转载】程序员接私活经验总结,来自csdn论坛语录
    【原创】Asp.Net MVC 学习笔记之使用Model验证
    【转载】经典js技巧
    【原创】关于Sqlserver的LogFiles超大的问题
    【总结】Winform编程常用小技巧
    【总结】WebBrowser相关资料索引
    【原创】Asp.Net MVC学习笔记之使用AcceptVerbs标签来制定Action的响应行为
    【转载】一个资深SOHO程序员对新人的建议网上接活(转自CSDN)
  • 原文地址:https://www.cnblogs.com/jzlblog/p/4333299.html
Copyright © 2011-2022 走看看