0

This is the code of my initializer:

if (self = [super init]) {
    self.title = @"Posts";
    self.variableHeightRows = YES;
    //XLog("");

    PostsDataSource *dataSource = [[[PostsDataSource alloc] init] autorelease];
    [dataSource.delegates addObject:self];
    [dataSource load:TTURLRequestCachePolicyMemory nextPage:NO];

    self.dataSource = dataSource;
}
return self;

In my datasource I'm doing a TTURLRequest and when requestDidFinishLoad gets called, my datasource gets filled with some items.

This all works quite good, but my TTableViewController doesn't show any of these files because it gets initialised and displayed before my datasource is finished. I know it works, because caching my datasource to disk shows all items.

The question is: How do I tell my TTableViewController to refresh the data out of my datasource file in my "requestDidFinishLoad" ?

4

1 回答 1

1

Is your datasource bound to a TTURLRequestModel? If so, you may be missing a call to:

[super requestDidFinishLoad:request];

If it's bound to a base TTModel, you may be missing a call to:

[self didFinishLoad];

These should happen in your requestDidFinishLoad: method.

Update Didn't realize you weren't using a TTModel. Does your requestDidFinishLoad call:

[self dataSourceDidFinishLoad];

Update again based on comments below The documentation or tutorial you were reading is way out of date and newer version of Three20 no longer work this way. There is a great tutorial at http://three20.info/tutorials/github which should get you back on the right track.

于 2010-02-24T22:37:04.373 回答