2012-02-02 72 views
0

我創建TTThumbsViewController大拇指(從JSON數據),當用戶點擊拇指,我的應用程序必須在新的子視圖打開的視頻是這樣的:如何在用戶點擊TTThumbsViewController中的拇指時顯示自定義視圖?

- (void)thumbsViewController: (TTThumbsViewController*)controller 
       didSelectPhoto: (id<TTPhoto>)photo 
{ 
    NSMutableArray *photoset = [[NSMutableArray alloc] initWithArray:[self.photoSource photos]]; 
    Photo *selected = [photoset objectAtIndex:[photo index]]; 

    NSLog(@"%@", [selected urlLarge]); 

    NSURL *url = [NSURL URLWithString:[selected urlLarge]]; 
    MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; 

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

    if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) { 
     moviePlayer.controlStyle = MPMovieControlStyleDefault; 
     moviePlayer.shouldAutoplay = YES; 
     [self.view addSubview:moviePlayer.view]; 
     [moviePlayer setFullscreen:YES animated:YES]; 
    } else { 
     [moviePlayer play]; 
    } 
} 

的NSLog顯示,拇指點擊,但它打開默認TTPhotoViewController :(我想禁用,並只顯示該子視圖。

回答

1

這可以幫助我,解決我的問題

- (void)thumbsTableViewCell:(TTThumbsTableViewCell*)cell didSelectPhoto:(id<TTPhoto>)photo { 
    [_delegate thumbsViewController:self didSelectPhoto:photo]; 
} 
相關問題