【发布时间】:2014-07-21 14:10:25
【问题描述】:
我的应用程序有点问题,对这种事情不熟悉,我有点难以弄清楚发生了什么。
我遇到的错误如下
线程 1:EXC_BAD_ACCESS(代码=exc_I386_GPFLT)
隐式转换丢失整数精度:“NSUInterger”(又名 unsigned long)到“u_int32”(又名“unsigned int”)**已解决*
第一个不显示为红色或黄色错误,它只是我的部分代码下的贪婪文本,在下面的“图 1”中显示
第二部分是数组中的黄色错误,用于选择要显示在UIImageView 中的随机图像(图2)
图 1
NSArray *imageNameArray = [[NSArray alloc] initWithObjects:@"toppipestyleone.png", "toppipestyletwo.png", "toppipestylethree.png", "toppipestylefour.png", "toppipestylefive.png", nil];
这是我放置UIImageView 的方法我在这个方法中也有代码告诉UIImageView 从屏幕的右到左滚动,我将在“图3”中发布我的整个方法
图2
PipeTop.image = [UIImage imageNamed:[imageNameArray objectAtIndex:arc4random_uniform([imageNameArray count])]];
图 3
-(void)PlacePipe{
NSArray *imageNameArray = [[NSArray alloc] initWithObjects:@"toppipestyleone.png", "toppipestyletwo.png", "toppipestylethree.png", "toppipestylefour.png", "toppipestylefive.png", nil];
PipeTop.image = [UIImage imageNamed:[imageNameArray objectAtIndex:arc4random_uniform([imageNameArray count])]];
RandomTopPipePosition = arc4random() %350;
RandomTopPipePosition = RandomTopPipePosition - 228;
RandomBottomPipePosition = RandomTopPipePosition + 660;
PipeTop.center = CGPointMake(340-10, RandomTopPipePosition);
randomImagebottom.center = CGPointMake(340-10, RandomBottomPipePosition);
}
我认为第二个错误与 32 位和 64 位设备有关,但我找不到针对我的确切问题的实际解决方案,我读到的大多数问题都是关于人们使用 NSZombies?我不太确定那是什么。
【问题讨论】:
标签: ios objective-c uiimageview nsarray