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

  • 相关阅读:
    CAN总线(1)--初探(更新中)
    无约束时钟导致综合实现效果不一致
    推荐几本FPGA书籍(更新中)
    Ubuntu下配置支持Windows访问的Samba共享
    svn 节点处冲突 解决
    clock()、time()、clock_gettime()和gettimeofday()函数的用法和区别
    Linux入门,这七大习惯得有!
    Ubuntu硬盘空间不足时,添加硬盘的方法
    让你快速学会Shell脚本
    printf与fprintf函数的区别
  • 原文地址:https://www.cnblogs.com/jzlblog/p/4333299.html
Copyright © 2011-2022 走看看