Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Uitableview .plist数据无法从NSArray加载到NSDictionary_Uitableview_Nsarray_Plist_Nsdictionary - Fatal编程技术网

Uitableview .plist数据无法从NSArray加载到NSDictionary

Uitableview .plist数据无法从NSArray加载到NSDictionary,uitableview,nsarray,plist,nsdictionary,Uitableview,Nsarray,Plist,Nsdictionary,我对Objective-C相当陌生 我已经在.plist上创建了所有存储在Response字典中的数据 NSString *myListPath = [[NSBundle mainBundle] pathForResource:@"OffersList" ofType:@"plist"]; dic = [NSDictionary dictionaryWithContentsOfFile:myListPath]; tableData = [dic objectForKey:@"Response"]

我对Objective-C相当陌生

我已经在.plist上创建了所有存储在
Response
字典中的数据

NSString *myListPath = [[NSBundle mainBundle] pathForResource:@"OffersList" ofType:@"plist"];
dic = [NSDictionary dictionaryWithContentsOfFile:myListPath];
tableData = [dic objectForKey:@"Response"];
 NSDictionary *dict = [tableData objectAtIndex:indexPath.row];
 cell.titleLabel.text = [dict  objectForKey:@"title"];
 cell.nowLabel.text = [dict objectForKey:@"price"];
 cell.saveLabel.text = [dict objectForKey:@"rondel"];
现在我已经将
tabledata
转换为Dictionary

NSString *myListPath = [[NSBundle mainBundle] pathForResource:@"OffersList" ofType:@"plist"];
dic = [NSDictionary dictionaryWithContentsOfFile:myListPath];
tableData = [dic objectForKey:@"Response"];
 NSDictionary *dict = [tableData objectAtIndex:indexPath.row];
 cell.titleLabel.text = [dict  objectForKey:@"title"];
 cell.nowLabel.text = [dict objectForKey:@"price"];
 cell.saveLabel.text = [dict objectForKey:@"rondel"];
现在,问题是它只加载前10个数据。
我也尝试在日志中打印,但在第10个数据之后,它的值被视为
NULL

尝试转储整个
dic
,以便您可以准确检查它包含的数据:

NSLog(@"Content of tableData", [dic description]);

然后用.plist内容仔细检查
tableData
元素的日志内容。

我已经尝试过了,但正如我告诉你的,在整个tableview都是空单元格之后,它只加载10个数据。你确定你的plist是正确的吗?您能检查并确保第11个元素是正确的吗?你们能试着删除它吗?是的,我在这里提问之前检查过。我还试着删除第11项。但是
没有结果
我马上就要解决问题了。我正在做的是尝试更改小的tableview大小。我只得到了前三个数据。在这之后,日志中的所有值都为空。有什么
想法
怎么做?