I am trying to instruct my app to open a certain view, depending on whether the user has already created a user profile on my database.
so basically -
- (void) viewWillAppear:(BOOL)animated {
//all my ASIHTTPRequest code here
//blah blah blah
NSString *responseString = [request responseString];
if ([responseString isEqualToString:@"noexistingdata"])
{
FriendsViewController *friendsview = [[FriendsViewController alloc] initWithNibName:nil bundle:nil];
//SOMETHING NEEDS TO GO HERE TO MAKE THIS WORK!
} else if ([responseString isEqualToString:@"success"])
{
//do whatever
}
}
I just want the most basic code for changing a view... I would try using IBAction, but obviously that won't work as this is in a void for the app's launch (rather a response to a button the user presses), also thought about void in a void, which also did not work.
So basically what I need is:
Launch App > App receives response from my server > (IF RESPONSE = "THIS", LOAD VIEW "X") (IF RESPONSE = "THAT", LOAD VIEW "Y")
Anyone have a clue?
PS: would it be better to list this is applicationDidFinishLaunching?