Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 79

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
11/23/13 11:49 AM (12 years ago)

Initiate back to last screen function

I'm trying to initiate the "back to last screen" function. David@BT referenced this 2 years ago (outdated): [[self.rootApp.rootTabBarController selectedViewController] popToRootViewController:YES]; I dug around BT_viewUtilities.m and found: [self.theViewController respondsToSelector:@selector(goBack)]; But no luck yet. Anyone know the correct reference? Thanks guys, David https://www.buzztouchmods.com/market
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/23/13 01:01 PM (12 years ago)
Try something like this: [self.navigationController popViewControllerAnimated:YES];
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/23/13 01:07 PM (12 years ago)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/23/13 01:25 PM (12 years ago)
where are you trying to call this? Can I see the full method?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/23/13 01:36 PM (12 years ago)
Check your email sent you two files! Thanks again. David https://www.buzztouchmods.com/market
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/23/13 06:05 PM (12 years ago)
@Chris got it done for me, want to post the solution here but it was a bit custom done with my project so it's not a easy awnser. If anyone is reading this and needs the answer email me and I can send you some project files to look at. Thanks! David https://www.buzztouchmods.com/market
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
11/24/13 11:25 AM (11 years ago)
Did the solution involve handleTapToLoadScreen?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/24/13 11:26 AM (11 years ago)
Nope - it used the method I mentioned above. Just a little more complicated bc he was doing it in a class method, but not hard.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
11/24/13 11:46 AM (11 years ago)
Ah yes, because he needed to pop off the stack. God help those who read my remark out of context! :-) -- Niraj
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/24/13 11:53 AM (11 years ago)
Lol
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
11/24/13 01:15 PM (11 years ago)
Buzztouch has it's own go to last screen method. [self navLeftTap]; as long as the class is a subclass of BT_viewController all will be good [someClass navLeftTap]; now I know some will say hey that does the same thing and it does. BUT this method is also linked to the audio player, so it knows if background audio should continue playing or not.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
11/25/13 07:51 AM (11 years ago)
Thanks. I'd love to see this trick. I've not exploited that built in BT method yet. I usually do it more formally as well with XIB's: // Initialize MyViewController object MyViewController *controller = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]]; // Pushes MyViewController object on the navigation stack [self.navigationController pushViewController:controller animated:YES]; That allows me to call whatever VC I want. Usually works great but sometimes you loose the BT navigation. Maybe that navLeftTap is something I should look closer at.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
11/25/13 08:11 AM (11 years ago)
navLeftTap is going in reverse ATrain. You should explore the handleTapToLoad method, and what it means to create a BT_item with code. (It's not hard). Just make your new viewControllers subclasses of the BT_viewController rather than a UIViewController. I know that's three kinda big things I just gave you to learn, but if you get a handle on them, you'll be amazed at what you can do.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
03/20/14 08:07 AM (11 years ago)
[self navLeftTap] does not work. Console log displays "nested pop animation can result in corrupted navigation bar" I also tried [self.navigationController popToViewControllerAnimated:YES] That had the same error message. Perhaps it is the distinction in using the Class, as in David's situation? -- Niraj
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
04/05/14 06:13 PM (11 years ago)
Hey! Today the [self navLeftTap] works! Go figure! Warning to those who are still reading ... viewWillDissapear will get invoked with that [self navLeftTap] -- Niraj
 

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.