Up vote 0 down vote favorite share g+ share fb share tw.
In my iPhone app, I have a requirement to present a new UIViewController on viewWillAppear event of a different UIViewController based on the condition. Actually I am trying to check whether user has logged in or not. I am trying something similar to what is present in eBay's iPhone app.
How can I do that? Any reference to tutorials would be really helpful Please Help. Thanks.
Iphone objective-c cocoa-touch iphone-sdk-4.0 viewwillappear link|improve this question edited Jan 31 '11 at 5:46 asked Jan 30 '11 at 13:30Parth Bhatt5,44231960 100% accept rate.
1 Maybe you could use a modal view. I don't know the eBay app. Therefore it's just a guess.
– dasdom Jan 30 '11 at 13:55.
I got the answer. We cannot present a View on -(void)viewWillAppear:(BOOL)animated of a different viewController. We have to add code for presenting a View on -(void)viewDidAppear:(BOOL)animated method.
Hope this helps someone. Thanks to all those to helped. :).
I am under the impression you have already decided where you want to put the logic to decide whether to show one view or another. ViewWillAppear is likely the wrong place because your interface xib file has already been loaded so any way you look at it you'd have to load a new UI at least some of the time. The best solution is probably for the code that is loading the UIViewController with the logged in UI to figure out if login needs to happen, and load an entirely different UIViewController for login, if that's the case.
The login view controller could then proceed to load the original view controller if login succeeds.
Thanks for the reply. Sorry but I am really not able to get what actually you are trying to explain. It would be great if you could elaborate a bit more.
Thanks once again :) Also loading a different UIViewController if login needs to happen is what I am not able to acheieve. How to do that? – Parth Bhatt Jan 31 '11 at 4:36.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.