iOS之数据存储
amberoot_源狼乐
It isn't the burdens today that drive me mad,it is the regrets over yesterday and the fear of tomorrow.
展开
-
iOS swift3.0 属性文件plist的应用
前言:iOS的属性文件(Property List)是以.plist结尾,以文件形式存储信息。我通常会创建一个根字典rootDict,然后把需要的各种格式数据根据Key写进根字典保存起来,需要的时候再根据对应的Key把数据提出来。当然,文件只保存少量关键数据,APP退出也不会影响到的数据。1. 文件路径-通常放在沙盒中的Documents文件夹中//工程中(私有的沙箱...原创 2017-08-30 11:49:02 · 260 阅读 · 0 评论 -
iOS swift3.0 以把字符串添加到文件结尾的方式保存数据
//把字符串写进文件,文件保存在沙盒中Documents路径中func writeStrToFile(receivedString: NSString) { let str = receivedString as String let wr = NSMutableData() wr.append(str.data(using:String.Encod...原创 2018-04-16 10:40:22 · 801 阅读 · 0 评论