适用于 iPhone 模拟器但不适用于设备 [英] Works on iPhone Simulator but not on device

查看:32
本文介绍了适用于 iPhone 模拟器但不适用于设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我添加了子视图(UIImageViews),它在模拟器上都有效,但在设备(iOS 4.1)上无效!?

Here I addsubviews (UIImageViews) it all works on the simulator but not on the device (iOS 4.1) wtf!?

- (void)addChips:(int)value {
UIImage *chipImage;
switch (value) {
    case 5:
        chipImage = [UIImage imageNamed:@"5chip"];
        break;
    case 25:
        chipImage = [UIImage imageNamed:@"25chip"];
        break;
    case 100:
        chipImage = [UIImage imageNamed:@"100chip"];
        break;
    case 500:
        chipImage = [UIImage imageNamed:@"500chip"];
        break;
    default:
        break;
}

int chipCount = [chipsOnBet count];
UIImageView *addChip = [[UIImageView alloc] initWithImage:chipImage];
addChip.opaque = YES;
addChip.frame = CGRectMake((kStackOffset * chipCount) + 131, 268, 57, 57);
[self.view addSubview:addChip];
[chipsOnBet addObject:addChip];
[addChip release];
}

推荐答案

  1. 确保您编写了正确的文件名,iOS 区分大小写,模拟器不区分大小写.
  2. 如果您在 iPhone4 上进行测试,请确保您拥有正确的视网膜文件

这篇关于适用于 iPhone 模拟器但不适用于设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆