我有这段代码,无法弄清楚我做错了什么。正如您在下面的代码中看到的那样shifts.plist
,我的supporting files
文件夹中有一个名为 plist 的文件。这是我的 plist 结构。
NSString *path = [[NSBundle mainBundle] pathForResource:@"shifts" ofType:@"plist"];
dictionary = [[NSMutableDictionary alloc]initWithContentsOfFile:path];
cell.textLabel.text = [secondTableInfo objectAtIndex:indexPath.row];
NSLog(@"%@",[[dictionary objectForKey:@"name"]objectAtIndex:0]);
我最终想阅读这些name
条目并用它们填充 a UITableView
。
我曾经NSLog
输出dictionary
,我得到了以下内容。所以文件在那里,只是我弄错了解析。
谢谢,
山姆