博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iphone 属性列表把数据保存到文件中
阅读量:7093 次
发布时间:2019-06-28

本文共 569 字,大约阅读时间需要 1 分钟。

将数组存放到文件中

NSArray * array1=[NSArray arrayWithObjects:@"wtw",@"wtm",nil];

[array1 writeToFile:@"/wtqwtq.txt" atomically:YES];

NSArray *get =[NSArray arrayWithContentsOfFile:@"/wtqwtq.txt"];

NSLog(@"%@",get);

 

将字典存放到文件中

NSMutableDictionary  *md;

md = [NSMutableDictionary dictionary];

[md setObject:[@"hello" lengthOfString] forKey:@"hello"];

[md setObject:[@"wangtianqiao" lengthOfString] forKey:@"wangtianqiao"];

 

 [md writeToFile:@"/wtqwtq.txt" atomically:YES];

NSMutableDictionary *get =[NSMutableDictionary dictionaryWithContentsOfFile:@"/wtqwtq.txt"];

NSLog(@"%@",get);

转载地址:http://sfiql.baihongyu.com/

你可能感兴趣的文章
如何实现phpcms v9_4X版本tag的伪静态?
查看>>
w3c标准的selection对象介绍
查看>>
Python-类属性与对象属性之间的关系
查看>>
JavaScript 函数参数传递到底是值传递还是引用传递
查看>>
LeetCode:105_Construct Binary Tree from Preorder and Inorder Traversal | 根据前序和中序遍历构建二叉树 | Medium...
查看>>
解决 No Entity Framework provider found for the ADO.NET provider
查看>>
转 用 Chrome 运行Android应用
查看>>
编程心得--不积跬步无以至千里
查看>>
thinkphp学习笔记8—命名空间
查看>>
在项目中几个需要学习的知识
查看>>
验证码安全问题汇总
查看>>
LINK : fatal error LNK1104
查看>>
WPF动态加载3D 放大-旋转-平移
查看>>
大型企业的渗透思路
查看>>
strace命令(收集整理,常看常新)
查看>>
Eclipse Console 加大显示的行数和禁止错误弹出
查看>>
$(document).height()与$(window).height()区别
查看>>
oracle字符集与客户端
查看>>
java线:辛格尔顿隐藏ThreadLocal实现线程数据共享
查看>>
MassTransit RabbitMQ 参考文档
查看>>