大家好我已经从plist加载了一个表,我正在尝试转到下一个tableviewController并使用与所选行相同的名称 PLIST KEY 加载下一个内容。这是我的代码,但当我正在做segue时,我从plist的第一个对象获取所有键的内容无法找到错误
0.43200000000000033 0.9880000000000007
答案 0 :(得分:0)
Plist字典具有字符串值的键。根据您的实现方式(例如,如果只是行号),您可以像这样访问它:
plistList = [[NSDictionary dictionaryWithContentsOfURL:url]valueForKey:[@([path row]) stringValue];
答案 1 :(得分:0)
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OSMainStoryBoard" bundle: nil];
YourClassName *controller = [storyboard instantiateViewControllerWithIdentifier:@"YourClassName"];
NSIndexPath *path = [self.tableView indexPathForSelectedRow];
NSURL *url = [[NSBundle mainBundle] URLForResource:@"MyPlist" withExtension:@"plist"];
controller.plistList = [[NSDictionary dictionaryWithContentsOfURL:url]valueForKey:path];
controller.plistArray = plistList.allKeys;
[self.navigationController pushViewController:controller animated:YES];