Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
11/26/14 10:50 AM (9 years ago)

Going Back a Screen, Programatically

I'm working on an app that doesn't use a nav bar, however on a screen or two, I do want to have a back button. This button is created on the XIB rather than the nav bar though, but I'm getting an erro when trying to call the IBAction to load the previous XIB. Here is my code, which works fine to move the screens forward, but not to go back. In this case, I am trying to go back to the login screen: //========================================================== // LOADS XIB FILE FOR LOGIN SCREEN //========================================================== -(IBAction)GoToLogin{ if ( IDIOM == IPAD ) { [[NSBundle mainBundle] loadNibNamed:@"CR_social_login~iPad" owner:self options:nil];} else { if(IsIphone5){ [[NSBundle mainBundle] loadNibNamed:@"CR_social_login" owner:self options:nil];} else{ [[NSBundle mainBundle] loadNibNamed:@"CR_social_login_iPhone4" owner:self options:nil];}} } However, Xcode pops this error: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<BT_screen_blank 0x7b7e5130> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key continueToAppButton.' I checked my classes, and they all seem to be OK... as far as I can tell. The classes of the views for each xib are set to their appropriate owner names. Any ideas? Thanks.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/26/14 10:19 PM (9 years ago)
why not just use [self navLeftTap]; ?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
11/27/14 10:52 AM (9 years ago)
Lol... Duh! Sometimes I can't see the forest through the trees. Thanks Chris! Worked perfectly, of course :) Usually with Xcode I assume a 2 word command is way too simple to actually work, haha. Thanks again.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
12/18/14 06:26 PM (9 years ago)
How do you reference navLeftTap from another viewController? [self navLeftTap]; yields no visible interface for "myCurrentViewController" what should self be changed too? [BT_viewController navLeftTap]; no known class method
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.