0

[mpc [[MPMoviePlayerController alloc]][[initWithContentURL:url]]]; でエラーが発生しました。initWithContentURL は宣言されていない識別子です。どうすれば修正できますか?

「ViewController.h」をインポート

@interface ViewController ()
{
    MPMoviePlayerController *mpc;
}

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)playButton:(id)sender {
    NSString *stringpath;[[NSBundle mainBundle]pathForResource:@"Lake Weekend September 13-14" ofType:@"m4v"];
    NSURL *url = [[[NSURL fileURLWithPath:stringpath]
    [mpc [[MPMoviePlayerController alloc]][[initWithContentURL:url]]];
    [mpc setMovieSourceType:MPMovieSourceTypeFile];
    
    [[self view ]addSubview:mpc.view];
    
    [mpc setFullscreen:YES];
    
    [mpc play];
}
@end
4

2 に答える 2