技术文章分类(180)

技术随笔(11)

swift读取和写入plist

1,读取

 

代码:

     var diaryList:String = NSBundle.mainBundle().pathForResource("DiaryList", ofType:"plist")
        var data:NSMutableDictionary = NSMutableDictionary(contentsOfFile:diaryList)
        var diaries:NSArray = data.objectForKey("Diaries") as NSArray
        println(data)

 

posted @ 2014-06-19 12:07  坤哥MartinLi  阅读(4049)  评论(0编辑  收藏  举报