开发者

Two URL Request for One TTTableViewController

开发者 https://www.devze.com 2023-03-16 00:21 出处:网络
Good Day Mates~ Is it possible in three20 that I will have one TTTableViewController, and the models behin开发者_StackOverflowd the data in the table are different TTURLRequestModels?

Good Day Mates~

Is it possible in three20 that I will have one TTTableViewController, and the models behin开发者_StackOverflowd the data in the table are different TTURLRequestModels?

...For Example the first row in the table is a data requested from URL "X", and the remaining rows in the table are data requested from another URL which could be URL "Y"

Thanks


I recommend you create a custom TTListDataSource which will combine both URL requests into a single data source. That's probably the easy way to do it.

In your TTTableViewController:

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)createModel {
  self.dataSource = [[[URLRequestsDataSource alloc]
                     initWithURLs:arrayOfURLs autorelease];
}

In the datasource model class, you can have 2 types of TTTableItem, depending of the source.

0

精彩评论

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