Mic*_*lum 0 nsmutablearray ios
我正在开发一个应用程序,它将使用自定义图像选择器并尽可能地尝试,我似乎无法让应用程序运行得非常正确.Xcode调试器标记以下"线程1:程序接收信号:"SIGABRT"."
- (id) init {
if ((self = [super init])) {
_images = [[NSMutableArray alloc] init];
_thumbs = [[NSMutableArray alloc] init];
}
return self;
}
- (void)addImage:(UIImage *)image {
[_images addObject:image];
[_thumbs addObject:[image imageByScalingAndCroppingForSize:CGSizeMake(64, 64)]];
}
Run Code Online (Sandbox Code Playgroud)
这是在新调试器的xcode 4中.提前致谢.
其中一个对象是零.以下代码将帮助您发现哪一个:
- (void)addImage:(UIImage *)image
{
if (image)
{
[_images addObject:image];
}
else
{
NSLog(@"image is nil");
}
UIImage *newImage = [image imageByScalingAndCroppingForSize:CGSizeMake(64, 64)];
if (newImage)
{
[_thumbs addObject:newImage];
}
else
{
NSLog(@"newImage is nil");
}
}
Run Code Online (Sandbox Code Playgroud)