我有一個應用程序在那裏我從攝像機捕獲圖像,並將其設置爲按鈕。iPhone應用程序崩潰與NSCFType setImage:forState
所以,與使用按鈕從照相機和抽頭捕獲圖像,我的應用程序崩潰後[NSCFType setImage:forstate]無法識別的實例
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
UIImage *resizeImage = [image imageWithImage:image scaledToSize:CGSizeMake(320, 480)];
//convert the selected image to NSData
toShowFullImage = UIImageJPEGRepresentation(resizeImage, 0.8);
//retain it for further use
[toShowFullImage retain];
//set the selected image to button
UIImage *newimage=[image imageScaleAndCropToMaxSize:CGSizeMake(75, 75)];
[button setImage:newimage forState:UIControlStateNormal];
}
在IOS 6.0.1發生與中止陷阱6錯誤這個崩潰
請發表你設置圖像.. –
@ParasJoshi代碼:我張貼代碼檢查我的編輯。 –
@ user1530787:您是如何將按鈕添加到您的視圖的?請張貼該代碼。 –