Anything wrong with this code?

Posted by ct2k7 on Stack Overflow See other posts from Stack Overflow or by ct2k7
Published on 2010-04-06T01:30:45Z Indexed on 2010/04/06 1:33 UTC
Read the original article Hit count: 354

Filed under:

I am using this to determine which view to go to next, from the result as input from UITableView. The following code isn't working, but I think it should be!

Do you see anything wrong with it?

NSString *option = [menuArray objectAtIndex:indexPath.row];


if (option == @"New Transaction"){

NTItems *nTItemsController = [[NTItems alloc] initWithNibName:@"NTItems" bundle:nil];   
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:nTItemsController animated:YES];
    [NTItems release];}
else if (option == @"Previous Transactions"){}
else if (option == @"Reprint a reciept"){}
else if (option == @"Settings"){}
else if (option == @"Logout"){
    LoginViewController *nTItemsController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];   
    // Pass the selected object to the new view controller.
    [self.navigationController pushViewController:nTItemsController animated:YES];
    [LoginViewController release];  }

© Stack Overflow or respective owner

Related posts about iphone