我一直在使用这个简单的代码在Xcode中播放电影,但是看到这个新的更新已经出来我总是遇到SIGBRT错误。有人能让我知道我做错了吗?
我的。文件:
#import <UIKit/UIKit.h>
#import <MediaPlayer/Mediaplayer.h>
@interface ViewController : UIViewController {
MPMoviePlayerViewController *playvideo;
}
- (IBAction) jump: (id) sender;
@end
微米。文件:
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (IBAction) jump: (id) sender
{
NSString *path = [[NSBundle mainBundle]
pathForResource:@"jump" ofType:@"mp4"];
playvideo = [[MPMoviePlayerViewController alloc]
initWithContentURL:[NSURL fileURLWithPath:path]];
[self presentMoviePlayerViewControllerAnimated:playvideo];
}
- (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 UIDeviceOrientationIsLandscape(interfaceOrientation);
}
@end
在视图上我有按钮,这是动作的链接。我也在使用故事板。 如果您有任何想法,请告诉我。
谢谢你。 罗伯特