Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 未在视图中加载图像_Objective C_Uiviewcontroller_Uiimageview - Fatal编程技术网

Objective c 未在视图中加载图像

Objective c 未在视图中加载图像,objective-c,uiviewcontroller,uiimageview,Objective C,Uiviewcontroller,Uiimageview,我已经创建了两个名为FirstView和SecondView的视图。SecondView的nib文件有一个UIImage视图对象作为其IBOutlet。现在,我从FirstViewController的方法中获得一个UIImage对象。现在,我正在使用该图像设置SecondViewController的imageView属性,然后在导航控制器中推送SecondView控制器的对象。第二个视图已加载,但该图像未显示在该视图中 代码如下: - (void)imagePickerController:

我已经创建了两个名为FirstView和SecondView的视图。SecondView的nib文件有一个UIImage视图对象作为其IBOutlet。现在,我从FirstViewController的方法中获得一个UIImage对象。现在,我正在使用该图像设置SecondViewController的imageView属性,然后在导航控制器中推送SecondView控制器的对象。第二个视图已加载,但该图像未显示在该视图中

代码如下:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo

{

   [[picker parentViewController] dismissModalViewControllerAnimated:YES];

   SecondViewController *secondView=[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];

   secondView.imageView.image=img;

   [self.navigationController pushViewController:secondView animated:YES];  

}
在SecondViewController nib文件中,是否检查UIImageView是否连接到控制器的imageView出口


您是否检查过调试器中的各种值是否为零?

一切都连接良好,亲爱的,但是secondViewController.imageView在NSLog中显示为空。如果imageView为空,则表示未在interface builder中正确设置出口。