2014-01-24 38 views
0

我試圖整合一個XCDMovieplayer,就像你通常會用MPMoviePlayer一樣。問題是它一直在解僱。MoviePlayer繼續解僱

這裏是我的代碼

- (void)viewDidAppear:(BOOL)animated { 
    XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:@"9bZkp7q19f0"]; 
    [self presentMoviePlayerViewControllerAnimated:videoPlayerViewController]; 
} 

錯誤:

你永遠不應該從viewDidLoad方法存在任何視圖控制器
Warning: Attempt to dismiss from view controller <ViewController: 0xa134b80> while a presentation or dismiss is in progress! 

回答

0

第一。

您的演示文稿調用後的代碼實際上可能會產生意想不到的行爲,而且您的視圖還未在屏幕上出現。

嘗試在viewDidAppear中呈現您的視圖控制器。

+0

不改變任何東西。仍然得到錯誤。 – user3195388

0

確保在viewDidAppear的開頭調用super。

[super viewDidAppear:animated];