我希望能够访问plist
。
- (void)viewDidLoad {
[super viewDidLoad];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Cars" ofType:@"plist"];
NSArray *array = [NSArray arrayWithContentsOfFile:filePath];
NSMutableArray *dealers = [[NSMutableArray alloc] init];
for (NSDictionary *object in array) {
Dealer *dealer = [[Dealer alloc] initWithDictionary:object];
[dealers addObject:dealer];
}
self.dealers = dealers;
从这里,我只访问plist
答案 0 :(得分:0)
你plist中的第一个NSDictinonary
具有存储经销商Item 0
的{{1}}密钥。更改字符串代码
NSDictinonary
到这个
Dealer *dealer = [[Dealer alloc] initWithDictionary:object];
答案 1 :(得分:-1)
我建议你检查variables-array,object