Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:50:07+00:00 2026-06-02T11:50:07+00:00

I have a method called handleLocalNotification in my AppDelegate that fires when my app

  • 0

I have a method called handleLocalNotification in my AppDelegate that fires when my app gets a notification. I need it to switch to tab 0 in my UITabBarController which contains a UITableview. I then need it to push on the correct row of the tableview to show the record sent by the notification. All Controllers are created in the storyboard, so I have no references to them in the AppDelegate.

I’ve added to my AppDelegate.h:

@class MyListViewController;
@interface iS2MAppDelegate : UIResponder <UIApplicationDelegate> {

    MyListViewController *_listControl;

}

and for testing I’m just putting this in the didFinishLaunchingWithOptions method:

UITabBarController *tabb = (UITabBarController *)self.window.rootViewController;
    tabb.selectedIndex = 0;
    _listControl = [tabb.viewControllers objectAtIndex:0];
    [_listControl.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:4 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];

The tabBarController bit works as I can get it to load up on different tabs. The last 2 lines cause it to crash. Have I gone about this the correct way? Or do I need to use a different method?
The crash reason is:

UINavigationController tableView]: unrecognized selector sent to
instance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:50:08+00:00Added an answer on June 2, 2026 at 11:50 am

    i suggest to use NSNotificationCenter try to do it like this

    - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
    {
      UITabBarController *tabb = (UITabBarController *)self.window.rootViewController;
      tabb.selectedIndex = 0;
     [[NSNotificationCenter defaultCenter] postNotificationName:@"localNotificationReceived" object:nil];
    }
    

    and in your viewController viewDidLoad :

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(selectRows) name:@"localNotificationReceived" object:nil];
    

    now you can use your tableView and do your stuff

    -(void) selectRows
    {
        [tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:4 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];
    }
    

    To programmatically select a cell , this may do the job :

    NSIndexPath *selectedCellIndexPath = [NSIndexPath indexPathForRow:4 inSection:0];
    [table selectRowAtIndexPath:selectedCellIndexPath 
                       animated:YES 
                 scrollPosition:UITableViewScrollPositionTop];
    [table.delegate tableView:table didSelectRowAtIndexPath:selectedCellIndexPath];
    

    because selectRowAtIndexPath will not fire the table delegate methods so you have to call with your self.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method called MatchNodes: IEnumerable<bool> MatchNodes<T>(T n1, T n2) Which basically gets
I have a method called ReadTill that has the same body of code but
I have a method that is called addHighScore. When a user wants to quit
I have an interface that contains a single method called ListAll() using System.Collections.Generic; namespace
I have a controller which has a method called history class UsersController < ApplicationController
I have recently found out that there exists a method called nth_element in the
Suppose that we have a class called class1. The class1 has a method called
I have a method called action() that deploys three threads. Each deployed thread or
I have a method called getTheUserInput in a class which returns a String which
Suppose that I have a method called doSomething() and I want to use this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.