【发布时间】:2011-07-22 00:09:26
【问题描述】:
我的应用附带一个如下所示的 .plist:
我希望用户能够添加自定义练习名称。
所以我需要在用户的文件夹中创建一个模仿这种格式的新 .plist。谁能帮我解决这个问题?
我需要这样的东西(伪代码)
if (userData == nil)
{
then create the .plist file;
setup the .plist to mimic the format of the img above.
}
now save exerciseName appropriately.
更新:
if (exerciseArray == nil)
{
NSString *path = [[NSBundle mainBundle]pathForResource:@"data" ofType:@"plist"];
NSMutableArray *rootLevel = [[NSMutableArray alloc]initWithContentsOfFile:path];
self.exerciseArray = rootLevel;
[rootLevel release];
}
【问题讨论】:
标签: iphone objective-c nsarray plist