我試圖從第一個視圖控制器傳遞UIImage到第二個視圖控制器,但這不會出現在第二個視圖。爲什麼?OBJECTIVE-C:PushViewController與UIImage不起作用
我在FirstController.m代碼:
SecondController *second = (SecondController *)[self.storyboard instantiateViewControllerWithIdentifier:@"SBSecondController"];
second.imgCard.image = [UIImage imageNamed:@"image.png"];
[self.navigationController pushViewController:second animated:YES];
我在SecondController.h代碼:
@property (nonatomic, strong) IBOutlet UIImageView *imgCard;
我在SecondController.m代碼:
@implementation SecondController
@synthesize imgCard;
非常感謝!這是解決方案:) @Subhash Sharma – David
:)開心的編碼 –