 |
 |
|
 |
02-09-2010, 09:18 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Posts: 46
|
Tab Bar with dynamically changed main view
Hi,
I'm creating a tab bar based app and for my initial app run I would like to
have a different main view than on the ongoing app runs.
I mean on the first run I want the user to first get view1 in the tab bar and
for other runs to get view2.
How do I achieve this?
Thanks
|
|
|
02-09-2010, 10:43 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Feb 2010
Posts: 11
|
Won't give you specific code, but here are the steps I would take.
1.) Store a boolean flag in the NSUserDefaults. This is a persistent storage location done by Apple, very easy to use.
2.) Check this flag in the app delegate in the applicationDidFinishLaunching method.
3.) If the flag is up (ie this is not your first load), change the ViewControllers in your TabBarController object.
Hope this helps.
|
|
|
02-09-2010, 02:22 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Dec 2009
Posts: 46
|
I'll clarify my question.
Is it possible to load tab bar item i when the tab bar controller loads and not just the first tab bar item?
Thanks
EDIT:I've found the solution, for anyone interested here it is:
self.tabBarController.selectedIndex = 1;
Last edited by embedded; 02-09-2010 at 02:29 PM.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 386 |
| 45 members and 341 guests |
| activ8, alex_ivanov, benoitr007, Blitfast, bobvanratingen, CAmaninacan, ColouredRobot, cye, dave1619, Dorald, fbronner, flamingliquid, icordoba, ImpresionesWeb, javaconvert, jbourne08, Jeremy1026, Jupiterus, Kalimba, kbegemandev, kkrizka, KSA_girl, linkmx, mikeyb, MiniRobinho, miv, mixer555, MrMattMac, Noise, Notable, orange gold, psilocybin, quky, richyclements, ricobeck, robmonty, Rudy, scalar, scotopia, shan, sourman, StefanL, teras, That Don Guy |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,257
Threads: 39,039
Posts: 171,222
Top Poster: smasher (2,573)
|
| Welcome to our newest member, arielgren |
|