tableView Cells仅填充在模拟器中

时间:2012-02-13 22:24:39

标签: iphone objective-c ios uitableview

我创建了一个使用tableViewController的应用程序,并从.plist文件的内容中填充其单元格。我认为我的应用程序运行正常,直到我尝试将其构建到我的iPhone上。事实证明,我的细胞只会在模拟器中运行时填充,我不能为我的生活找出原因。以下是该问题的一些屏幕截图。

App Running in Simulator

On iPhone

enter image description here

我知道这可能是一个简单的修复,但我无法理解。任何帮助将不胜感激。提前谢谢!

2 个答案:

答案 0 :(得分:2)

检查您的文件名以及读取plist文件的代码。确保获得正确的大小写,Simulator不区分大小写,而iOS区分大小写。这更可能是导致问题的原因。

答案 1 :(得分:0)

NSString *path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"plist"];
NSDictionary *drinksDict = [NSDictionary dictionaryWithContentsOfFile:path];
相关问题