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

  • SEARCH
  • Home
  • 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 6857641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:03:03+00:00 2026-05-27T02:03:03+00:00

I’ve got a question regarding displaying local notification reminders inside the application. I think

  • 0

I’ve got a question regarding displaying local notification reminders inside the application. I think the problem lies with the view controller.

here’s the code I have so far:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    UIViewController *viewController1, *viewController2;
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        viewController1 = [[Number1ViewController alloc] initWithNibName:@"Number1ViewController_iPhone" bundle:nil];
        viewController2 = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController_iPhone" bundle:nil];
    } else {
        viewController1 = [[Number1ViewController alloc] initWithNibName:@"Number1ViewController_iPad" bundle:nil];
        viewController2 = [[SettingsViewController alloc] initWithNibName:@"SettingsViewController_iPad" bundle:nil];
    }
    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];


        UILocalNotification *notification = [launchOptions objectForKey:

                                             UIApplicationLaunchOptionsLocalNotificationKey];


        if (notification) {

            NSString *stringReminder = [notification.userInfo 

                                      objectForKey:@"TextforReminder"];

            [viewController showReminder:stringReminder];


        }


    }



    application.applicationIconBadgeNumber = 0;
    [[UIApplication sharedApplication] cancelAllLocalNotifications];


    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
    return YES;
}

or:

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {

    UIApplicationState state = [application applicationState];

    if (state == UIApplicationStateInactive) {

        application.applicationIconBadgeNumber = 0;
        [[UIApplication sharedApplication] cancelAllLocalNotifications];


        NSString *stringReminder = [notification.userInfo

                                  objectForKey:@"TextforReminder"];

        [viewController showReminder:stringReminder];

    }

}

However I am getting errors regarding the view Controller. Use of undeclared identifier ‘viewController’. I understand that this is becuase there is no view controller, however I don’t unterstand how I have to achieve, that the Reminder is shown in the process.

Thanks a lot for your help, I am not getting further in this problem.

Cheers

  • 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-05-27T02:03:04+00:00Added an answer on May 27, 2026 at 2:03 am

    As your warning is trying to tell you the problem in application:didFinishLaunchingWithOptions: is in.

    if (notification) {
        NSString *stringReminder = [notification.userInfo objectForKey:@"TextforReminder"];
        [viewController showReminder:stringReminder];
    }
    application.applicationIconBadgeNumber = 0;
    [[UIApplication sharedApplication] cancelAllLocalNotifications];
    

    UIViewController has no method named showReminder:, so I assume it’s in your subclass of one of your UIViewController subclasses.

    You need to do two things,

    1) Replace ‘viewController‘ with either ‘viewController1‘ or ‘viewController2‘ whichever has the method showReminder:

    2) You need to wait until these viewControllers are actually on screen before presenting more views on top of them. So move the block above to after the [self.window makeKeyAndVisible] but before return YES.

    Edited as comment says SettingViewController will have the showReminder: method;

    As far as the problem receiving LocalNotifications while the app is running. If your app is simple then maybe just replace ‘viewController‘ with:

    (SettingsViewController *)[self.tabBarController.viewControllers objectAtIndex:1]

    Since in your code you add it as the second element of the viewControllers property.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.