以下代码片段使用 iPad 模拟器和 iphone 模拟器可以正常工作。但是,当我在 ipad 2 上运行 UIImage 时(使用 iphone 模式),UIImage 为零(在调试时检查)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"flowerCell"];
    switch (indexPath.section) {
        case kRedSection:
            cell.textLabel.text=[self.redFlowers objectAtIndex:indexPath.row];
            break;
        case kBlueSection:
            cell.textLabel.text=[self.blueFlowers objectAtIndex:indexPath.row];
            break;
        default:
            cell.textLabel.text=nil;
    }
    NSString *img=[[NSString alloc] initWithFormat:@"%@%@", cell.textLabel.text, @".png"];
    UIImage *flowerImage=[UIImage imageNamed:img];
    cell.imageView.image=flowerImage;
    return cell;
}
这是从教程书中摘录的比利基本 iphone 示例,并且是第一次出现此问题。