Reloading the model of a TTTableViewController

Posted by user341338 on Stack Overflow See other posts from Stack Overflow or by user341338
Published on 2010-06-05T09:26:48Z Indexed on 2010/06/05 9:32 UTC
Read the original article Hit count: 315

Filed under:
|
|

My problem is that I have a Register Controller and a Login Controller. The Login Screen displays a Login Screen or a Logout Screen depending if a user is logged in. Now when a user registers, does not close the app, and then goes to the Login Screen it will still display a Login Screen, although there is a logged in user already. This is because the Screen is created when the application loads and does not change afterwards.

I tried doing this:

- (id)init {
if (self = [super init]) {
    [self invalidateModel];
    [self reload];

but that did not work, since it is only called on the first init.

then i tried:

- (void)viewDidLoad {
[self invalidateModel];
[self reload];
}

But that method had the same problem.

Then I found this method:

- (TTNavigationMode)navigationModeForURL:(NSString*)URL;

with the following options:

 typedef enum {
  TTNavigationModeNone,
  TTNavigationModeCreate,            // a new view controller is created each time
  TTNavigationModeShare,             // a new view controller is created, cached and re-used
  TTNavigationModeModal,             // a new view controller is created and presented modally
  TTNavigationModeExternal,          // an external app will be opened
} TTNavigationMode;

It seems like TTNavigationModeCreate would be the right thing to use, but I have no clue how to use it.

Any help? Thnx.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c