弹出当前 UIViewController 后,如何在以前的 UIViewController 上创建 UIView。
在我以前的 UIViewController 上,我有一个可以在其他 UIViewControllers 上访问的函数:
-(void)setMovieCompare:(NSString *)_movieName {
NSLog(@"Movie Compare %@",_movieName);
UIView *vw2ndPlayer = [[UIView alloc] initWithFrame:CGRectMake(0, 44, 320, 166)];
[self.view addSubView:vw2ndPlayer];
}
然后在我当前的 UIViewController 上,我有:
VideoPlayerViewController *_VideoPlayerViewController = [[VideoPlayerViewController alloc] initWithNibName:nil bundle:nil];
[_VideoPlayerViewController setMovieCompare:mediaObject.name];
[self.navigationController popViewControllerAnimated:YES];
它导致我:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString appendString:]: nil argument'
*** First throw call stack:
(0x31a3e2a3 0x398a297f 0x31a3e1c5 0x31a0d773 0x72461 0x74077 0x33865595 0x7600b 0x7aa6d 0x3390828d 0x3398af81 0x3234c277 0x31a135df 0x31a13291 0x31a11f01 0x31984ebd 0x31984d49 0x3553b2eb 0x3389a301 0x6e89d 0x39cd9b20)
libc++abi.dylib: terminate called throwing an exception