views:

431

answers:

1

Hi,

i created a TTViewController that should show some Informations from a external (web) source. i already worked with some TTableViewControllers where i used the TTModel System (i created a TTURLRequestModel and a TTListDataSource for my TTTableViewControllers)

whats the way to do this with a TTViewController? is there also something like a DataSource and Request Model or do i have to assign my ViewController with the TTURLRequestDelegate and run a simple URL Request?

im asking because i dont know whats the "best" and "newest" way to fill my viewcontroller with data from the web. i know how to do this for tableviews but not for views.

thanks in advance

edit: some code

my singlePostViewController:

@interface singlePostViewController : TTModelViewController 
       singlePostModel *_singlepostmodel; 
@end 
- (void) createModel { 
        _singlepostmodel = [[singlePostModel alloc] init]; 
} 

and my singlePostModel

@interface singlePostModel : TTURLRequestModel { 
} 

@end 

but what to do now? where to load my stuff and setting it up?

+3  A: 

Check out the TTModelViewController class. You'll want to subclass that. You create the TTURLRequestModel in the createModel: method and add "self" to the list of model's delegates. There are a bunch of interesting methods available that should be sufficient for what you're trying to do.

In particular, this PDF shows a good relationship between the model, datasource, and controller classes.

Algorithmic
hm have you something like an example for that, or a tutorial?
choise
Added a link to a useful PDF.
Algorithmic