开发者

three20 TTTableView didSelectObject not beeing called

I populated data in my TTTableViewController with subclass of TTSectionedDataSource filled with TTTableTextItem.

 [items addObject:[TTTableTextItem itemWithText:title URL:@"tt://page"]

The TTTableViewController can display without any problem. But when I click the cell, it will be selected with blue color but no further action.

Then I implement didSelectObject and try to figure out what's happen:

- (void) didSelectObject:(id)object atIndexPath:(NSIndexPath *)indexPath {

    NSLog(@"%@",@"hahaha");
}

But no log shows up, this method won't be called. Help, please.

Updated:

Finally, I found the problem. My TTTableViewDragRefreshDelegate didn't init properly.

- (id<UITableViewDelegate>) createDelegate {

    return [[[TTTableViewDragRefreshDelegate alloc] init] autorelease];

}

It shoule be :

- (id<TTTableViewDelegate>) createDelegate {

    TTTableViewDragRefreshDelegate *delegate = [[TTTableV开发者_如何学JAVAiewDragRefreshDelegate alloc] initWithController:self];

    return [delegate autorelease];
}


I believe didSelectObject method is only called when URL is set to nil in your TTTableTextItem, since it specifies that you want to handle the click yourself. Try setting it nil and see if your didSelectObject gets called. But if you don't want any specific action being done by clicking on the item besides opening up a new ViewController, you shouldn't need to override the method. Just make sure that your @"tt://page" actually points to something in your TTURLMap

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜