我想读,我也需要写一个plist。 。从plist读到NSArray
到目前为止,我想简单地读取其内容
这里是我的appSettings.plist:
NSBundle* bundle = [NSBundle mainBundle];
NSString* plistPath = [bundle pathForResource:@"appSettings" ofType:@"plist"];
NSDictionary *tmp = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
我试着这样做:
NSArray *mruItems = [[NSArray alloc] initWithArray:[tmp objectForKey:@"lastSearches"]];
但它会引发错误。我对[tmp objectForKey:@“lastSearches”]类型进行的检查显示这不是NSArray ...
如何将内容读入我的NSArray?
谢谢!
(我很想有编写过一些信息)
我可能已经做了lastSearches一个字典,而不是一个数组... – Ted 2012-07-11 12:45:22