views:

230

answers:

3
A: 

In your login IBAction, send the LoginViewController the pushViewController: animated: message. That message and its counter-part, popViewControllerAnimated: is available in the UINavigationController class.

Unfortunately, your LoginViewController isn't a UINavigationController.

You can fix that particular error by changing it to:

[self.navigationController pushViewController:self.dataController animated:YES];

That assumes that LoginViewController is being hosted by a UINavigationController.

Giao
Thanks for your time and your answer,I have just tried this one but nothing happens, i can see only the indicator loading but no redirection to the next page.You think that the login page has to be an UINavigationController?
Thomas Sofras
I found this that maybe it is helpfull, but i don't know how i have to change my code to use it, i tried but i am getting errorshttp://starterstep.wordpress.com/2009/03/05/changing-a-uinavigationcontroller%E2%80%99s-root-view-controller/
Thomas Sofras
A: 

Giao is right. you need to tell a navigationController to push the view, not a viewController subclass. the navigationController should be handling all your view controllers that you want for the hierarchically structured part of your application. your navigationController should use its initWithRootViewController: method first to load your logincontroller and show its view. then when you want to display the next view, you send the navigtionController the pushViewController:animated: message with the next viewController who's view you want to display.

Remover
A: 

Another approach would be to create your first view as the Navigation Controller holding the UITableView and then on viewWillAppear, you check to see if the user has logged in. If they are not yet logged in, present the LoginViewController you create as modal. The benefit of using the modal is the root view will be your tableview. If your app has a tabbar and your first navigation controller view is the loginview controller, each time you hit the tab bar item, your login view will display.

Hope this helps.

stitz
thanks for the help my friend, this was for my masters capstone project :DDidnt figure out what to do, so i have changed my mind and made something with java.However when i have time i will try again :D
Thomas Sofras