我想將圖像發送到下一個scent.but失敗。prepareForSegue中的賦值爲false
這裏是我的代碼
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSLog(@"prepareForSegue start");
NSLog(@"count is %d",count);
//bigStyle1 is a NSArray,full of UIImage
//bigImage is a UIImageView outlet
if ([bigStyle1 objectAtIndex:count]==nil) {
NSLog(@"no array image");
}
viewController3.bigImage.image=[bigStyle1 objectAtIndex:count];
if (viewController3.bigImage.image==nil) {
NSLog(@"no controller image");
}
NSLog(@"secondToThird");
NSLog(@"prepareForSegue end");
}
這裏是Xcode的日誌
2013-03-12 15:15:38.683 animation[1876:f803] prepareForSegue start
2013-03-12 15:15:50.825 animation[1876:f803] count is 0
2013-03-12 15:17:10.829 animation[1876:f803] no controller image
看來這個問題是image.Why分配的任務失敗了嗎?
UPDATE viewController3不nil.But bigImage是nil.I不知道why.I實際上bigImage連接到圖像視圖
你確定'bigStyle1'不爲空? – Fonix 2013-03-12 07:54:03
'viewController3'是segue的目的地嗎?設置'viewController3'的代碼在哪裏? – 2013-03-12 07:57:04
我敢肯定bigStyle1不是null,viewController3是由storyboard實例化的。 – 2013-03-12 08:04:58