Alwin Varghese Alwin Varghese - 1 year ago 67
Objective-C Question

i am doing sign Up page, when status=success i want to go back to the sign in page. but here not happening?

progress:nil success:^(NSURLSessionTask *task, id responseObject)
NSLog(@"%@",[responseObject valueForKey:@"status"]);
NSString *status=[responseObject valueForKey:@"status"];

if([[responseObject valueForKey:@"status"] isEqual: @"success"])

here i want to goback to root ViewController

[self.navigationController popViewControllerAnimated:YES];

but nothing is happening here


failure:^(NSURLSessionTask *operation, NSError *error) {

NSLog(@"Error: %@", error);

Answer Source

Create a segue like you have previously, except drag a segue from the 'Sign up' view controller, to the 'Sign in' controller.

With the segue selected, set its Identifier in the Attributes inspector to say 'goToSignIn'. Change your code to

if([[responseObject valueForKey:@"status"]  isEqual: @"success"])
    [self performSegueWithIdentifier:@"goToSignIn" sender:self];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download