“loading” spinner not leaving the TTTableViewController
I had a TTTableViewController used in iPad and initially I want it to be empty. When it first loads it actually calls:
- (id)initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query {
if (self = [super init]) {
self.dataSource = nil;
}
return self;
}
However, the "loading" spinner stays in there and won't go away. Why is this? I thought that this could happen because init wasn't called, but inde开发者_运维百科ed it is. I need some help.
When a TTTableViewController
is presented on screen, it accesses it's model. If there's no model set, like in your case it creates a model in [TTModelViewController createInterstitialModel]
. By default this will be a TTModel (the class not the protocol), which in turn does nothing then appearing to be loading.
In your createModel
implementation you would need to create a model that does what you want and assign that to self.model.
Also note, that creating dataSources and / or model in the initializer is not optimal, consider creating your dataSources / models in createModel
. They will be created only when needed (when the view appears on screen).
精彩评论