2012-03-21 66 views
0

我是iOS新手,完成了我在故事板中使用SplitView構建的第二個項目。我在iOS 5中構建了這個,現在在5.1中看到,在縱向視圖中,我的彈出窗口現在是一個滑塊。我閱讀了5.1版的Apple筆記,並決定讓tableview保持滑塊狀態。我有一組電影,在行選擇時觸發,選中時會全屏顯示。在主視圖可見時,在景觀中,事情可以按預期正常工作。在didSelectRowAtIndexPath視頻觸發並進入全屏,肖像模式(我的彈出窗口現在是一個滑塊),在didSelectRowAtIndexPath視頻不會觸發全屏,它實際上在主視圖中播放,我的詳細視圖內容保持在視圖中。我在這裏錯過了什麼?這是我在表視圖代碼(noLandscape是MPMoviePlayerViewController一個子類:iPad MPMoviePlayerController UISplitView中的iOS 5.1問題

(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    VideoInfo *videoInfo =(VideoInfo*) [listData objectAtIndex:indexPath.row]; 

    NSString *path = [[NSBundle mainBundle] resourcePath]; 

    path = [path stringByAppendingPathComponent:videoInfo.strFileName]; 

    NSURL *movieURL = [NSURL fileURLWithPath:path]; 

    MoviePlayerViewCtrler = [[noLandscape alloc] initWithContentURL:movieURL]; 

    [[NSNotificationCenter defaultCenter] addObserver:self 
              selector:@selector(moviePlayBackDidFinish:) 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:MoviePlayerViewCtrler]; 


    [MoviePlayerViewCtrler.moviePlayer prepareToPlay]; 
    [self presentMoviePlayerViewControllerAnimated:MoviePlayerViewCtrler]; 
    [MoviePlayerViewCtrler.moviePlayer play]; 

} 

感謝您的幫助

回答

0

你需要在你的detailviewcontroller播放的電影,而不是masterviewcontroller因此,在您detailviewcontroller需要通過在masterviewcontroller中選擇哪行來發送消息,然後在詳細信息視圖中加載相應的影片,然後彈出模態視圖以顯示影片