当前位置:编程学习 > wap >>

iPhone开发 读取plist中的值

//获取文件路径

    NSString *path = [[NSBundlemainBundle] pathForResource:@"user.plist"ofType:@""];

    //获取数据

    NSMutableDictionary* dict =  [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];

    NSString* object = [ dict objectForKey:@"aaa" ];

    NSLog(object);

 摘自 凡娃软件

 

    //修改数据

    NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];

    [ dict setObject:textview.text forKey:@"bbb" ];

    [ dict writeToFile:path atomically:YES ];

补充:移动开发 , IOS ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,