我正在使用情节提要-我对此很陌生-
当我单击一个EXC_BAD_ACCESS
指向code=2
.address = 0x4
MPMoviePlayerViewController
为了让您了解我到目前为止所获得的信息:我ViewControllers
在同一个ViewController
.h/m 类下有几个不同的,导航由 .h/m 控制NavigationController
。我从 a NavController
and single开始,ViewController
并一直ViewControllers
用简单的 CTRL-Click button-to-new- 链接 new- ViewController
。我添加了一个新的ViewController
;将其类更改MPMoviePlayerViewController
为身份检查器的自定义类部分,但是当我单击按钮开始转换时,我不断收到此错误。
ViewController.h
如果相关,这是我的代码:
- (IBAction)postToTwitter:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText:@"Check this out!"];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
}
- (IBAction)postToFacebook:(id)sender {
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[controller setInitialText:@"Posted from IOS App Test -- It works!"];
[self presentViewController:controller animated:YES completion:Nil];
}
}
- (IBAction)playVideo1:(id)sender {
NSURL * url = [[NSURL alloc]initWithString:@"link omitted"];
//create our moviePlayer
moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:url];
[self.view addSubview:moviePlayer.view];
//Some additional customization
moviePlayer.fullscreen = YES;
moviePlayer.allowsAirPlay = YES;
moviePlayer.shouldAutoplay = NO;
moviePlayer.controlStyle = MPMovieControlStyleDefault;
}