UITableView为iPhone 4s和iPhone 5提供不同的输出(两者都有iOS 6)

时间:2013-07-08 13:08:36

标签: ios objective-c uitableview iphone-5

我创建了iPhone应用程序,其中我有UITableView,我正在显示用户列表。

我的代码为

-(UITableViewCell *) tableView:(UITableView *) tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    // new is JSON data of list of users...
    news = [NSJSONSerialization JSONObjectWithData:data options:nil error:nil];
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MainCell"];
    if (cell==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MainCell"];
    }
    // here in cell I have code to assign data...
    return cell;
}

现在我添加/删除一些用户

iPhone 4s或更低版本中,它会为我提供更新列表。

然而,在 iPhone 5 中,它为我提供了以前的列表数据(与之前相同的数据)。删除的数据都不会从列表中删除NOR新添加的用户会显示在列表中。

注意:

当我使用iPhone 5模拟器在Simulator中运行此应用程序时,它可以正常工作。

我有适当的删除和一切,因为它与iPhone 4s及以下完美配合。问题出在iPhone 5上。

任何想法为什么iPhone 5会出现这种奇怪的行为?


编辑1

我在这个应用程序中看到的最令人震惊的事情是当我在iPhone 5上运行应用程序并在UITableView中添加数据时看到NSLog,我看到与以前相同的NSLog ... e.x.即使Id 5数据不存在,我仍然会看到id 5。

知道为什么会这样吗? 这真让我疯狂......


编辑2

现在再一次令人震惊的消息是,当我尝试使用我的朋友iPhone 5时,效果很好。 *但不是在客户端iPhone 5上,现在也不在iPhone 4上

知道为什么会发生这种奇怪的事情?

0 个答案:

没有答案