three20 - loading external Data for TTViewController

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?

Answers


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.


Check this twitter example https://github.com/facebook/three20/tree/master/samples/TTTwitter Its straightforward example.

You need to override "-(void) load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more" method in your subclass of TTURLRequestModel to fetch remote data.


Need Your Help

Java melody monitoring only one webapp tomcat

tomcat monitoring java-melody

I want to use java melody to monitoring may webapp on server tomcat. In path /var/lib/tomcat6/webapps i hava list like this

Open Source Speech Recognition Software in Java

java android speech-recognition

I've been thinking lately to start an application based on Speech recognition.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.