现在的位置: 首页 > 综合 > 正文

How to override TTThumbsViewController didSelectPhoto protocol method? 选项

2013年12月17日 ⁄ 综合 ⁄ 共 959字 ⁄ 字号 评论关闭

I've found that adding the delegate 'TTThumbsViewControllerDelegate' 
to the header, and setting the delegate as 'self' in viewDidLoad does 
the trick. i.e. 

Header changes: 

@interface WalkingTourPhotoGalleryController : TTThumbsViewController 
<TTThumbsViewControllerDelegate> 

        int _photoCnt, _trekID, _trekType; 
        NSString* _trekName; 

Source changes: 

- (void)viewDidLoad { 
       self.delegate = self; 
... 

- (void)thumbsViewController:(TTTThumbsViewController*)controller 
didSelectPhoto(id<TTPhoto>) { 
       NSLog(@"Photo selected"); 

Hope this is of help. 

Seidr 

On May 19, 10:58 pm, rAndomPi <rando...@gmail.com>
wrote:

 

I found a simpler solution. Adding createPhotoViewController in your 
TTThumbsViewController subclass: 

- (TTPhotoViewController*)createPhotoViewController 

    return [[[MyPhotoViewController alloc] init] autorelease]; 

MyPhotoViewController has to be a subclass of TTPhotoViewController. 
That might not suit your case, but it's another simpler solution. 

On Jul 14, 10:51 am, Seidr <seidrhr...@googlemail.com>
wrote:

抱歉!评论已关闭.