0
HI我有一個UITableview,當用戶點擊一個特定的單元格時,我使用MPmovieplayercontroller播放視頻,視圖正確播放,頂部有一個完成按鈕。當我點擊完成按鈕時,我需要回到主視圖控制器,wchih具有UIble視圖。請參閱下面的代碼,並告訴我可以做些什麼。來自UITableview的MPMoviePlayerController
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
NSString *surl = [videoSelected valueForKey:@"video_path"];
NSLog(@"Video :%@",surl);
NSURL *url = [NSURL URLWithString:@"http://localhost/MyWorks/files/videos/hit.mp4"];
MPMoviePlayerController *player =[[MPMoviePlayerController alloc] initWithContentURL: url];
[[player view] setFrame: [self.view bounds]]; // frame must match parent view
[self.view addSubview: [player view]];
[player play];
[msg release];
}
它說「對象MPMovieplayercontroller無法找到屬性navigationItem」 – UnlimitedMeals
嘗試'player.navigationController.navigationItem' –
nope這不起作用。 – UnlimitedMeals