سؤال

hi I've created an iphone app. I am using 5 tab bar items. By default, when app gets launched, it shows up first tabbar. What i want to do is to display 3rd tab bar when application is launched. How can i do that?

Best regards, Abdul qavi

هل كانت مفيدة؟

المحلول

In the application didFinishLaunchingWithOptions method of your AppDelegate, some time before the end, add the indicated line.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    . . . 

    // Add this line
    tabcontroller.selectedIndex = 2;

    [window addSubview:tabcontroller.view];
    [window makeKeyAndVisible];
    return YES;
}

Note that the 2 is the tab to switch to, starting with 0 for the first tab.

نصائح أخرى

just set the selectedItem property of the tabbar to the number you want to show up.

hAPPY iCODING....

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top