Hi I have a tabbar controller which includes two pages A and B. Now I just want to add TTTableViewDragRefreshDelegate
to page A.
If I put the code:
- (id<TTTableViewDelegate>) createDelegate {
TTTableViewDragRefreshDelegate *delegate = [[TTTableViewDragRefreshDelegate alloc] initWithController:self];
return [delegate autorelease];
}
Into UITabBarController
then both A and B got refresh, so I put above code into A's view controller and call A's view controller in UITabBarController
like this:
if (_page == APage) {
AViewController *_aViewController = [[[AViewController alloc] init] autorelease];
self.dataSource = _aViewController.dataSource;
...
}
But seems not work, page A still not get drag and refresh. So how can I get TTTableViewDragRefreshDelegate
only for page A in a UITabBarController
?
This is AViewController
init code:
- (id)init {
if (self = [super init]) {
self.variableHeightRows = YES;
id<TTTableViewDataSource> ds = [APageDataSource dataSourceWithItems:nil];
ds.model = CreateTabModelWithCurrentSettings();
self.dataSource = ds;
}
return self;
}
How to let make page A get all AViewController
's properties? Like AViewController
's model, dataSource
, something like that?
AViewController should be a subclass of TTTableViewController
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With