모두 안녕하세요. iOS 5에서 비디오를 재생할 때 문제가 있습니다. 프로그램을 만들 때 "로컬 인스턴스 선언을 숨김"이라는 경고가 나타나고 프로그램을 실행하고 버튼을 누릅니다. 나는 "SIGABRT"를 얻는다. 그리고 나는 무엇을 해야할지 모르겠다. 내가 얻을 수있는 모든 도움은 충분하다. !! 사전iOS 5 동영상 플레이어
MY .H 파일
#import "MainViewController.h"
@interface MainViewController()
@end
@implementation MainViewController
-(IBAction)Video:(id)sender {
MPMoviePlayerController *moviePlayer;
NSString *path = [[NSBundle mainBundle] pathForResource:@"big-buck-bunny-clip" ofType:@"m4v"];
NSURL *videoURL = [NSURL fileURLWithPath:path];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
[moviePlayer setControlStyle:MPMovieControlStyleDefault];
[moviePlayer.view setFrame: self.view.bounds];
[self.view addSubview: moviePlayer.view];
[moviePlayer prepareToPlay];
[moviePlayer play];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
@end