如何在弹出当前UIViewController后在我以前的UIViewController上创建一个UIView。从另一个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
你确定没有在这两个类中使用'appendString'? –
我在我的上一个UIViewController的某些部分使用appendString,但它只在ViewDidLoad上调用。 –
可能在那里,你传递的参数是无应用程序崩溃的无响应。 –