Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy Tabbar selected item is always 0?
    primarykey
    data
    text
    <p>I tried to print this value from another class but it is always showing selected <code>tabbar</code> index as 0</p> <p>Why? is there any other method to identify which tab is selected now?</p> <p>in my 2nd class <code>tableviewcontroller</code> <code>didselect</code> `method I am trying to print the following line</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; sharedManager=[Mymanager sharedManager]; sharedManager.navigationBarTitle=[name objectAtIndex:indexPath.row]; NSLog(@"%d",self.tabBarController.selectedIndex); } </code></pre> <p>but it is always showing <strong>0</strong> ?</p> <p>I need different index for different tab?</p> <p><strong>my intention is to identify tabs and call method now i change that to call four different methodes but when i created one object and tried to call method it not displaying why?</strong></p> <p><strong>My APpdelegate.m</strong></p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. [NSThread sleepForTimeInterval:5.0]; [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; [[NSNotificationCenter defaultCenter] postNotificationName:@"internet connection" object:self]; dispatch_queue_t connectivityThread = dispatch_queue_create("com.ttt.test.connectivity", NULL); dispatch_async(connectivityThread, ^{ while (true){ if([GMMConnectivity hasConnectivity]) [[NSNotificationCenter defaultCenter] postNotificationName:@"InternetCheck" object:[NSNumber numberWithBool:YES]]; else [[NSNotificationCenter defaultCenter] postNotificationName:@"InternetCheck" object:[NSNumber numberWithBool:NO]]; usleep(5000000); } }); return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } //-(void)recentPages:(NSString *)pageNumber //{ // //NSLog(@"%@",pageNumber); //} - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload