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 3437864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:07:02+00:00 2026-05-18T08:07:02+00:00

I need to know if it is possible to create a new thread to

  • 0

I need to know if it is possible to create a new thread to handle setting local notifications.

My app depends heavily on these notifications, so I want to make the app work while the phone sets the notifications.

Example:

(now)

you launch the app, the app hangs at the splash screen to set the local notifications, then it launches.

(I want)

The app launches and is usable while the Local notifications are set.

I need some sample code, too, please 🙂

(for the record, i am setting 60 local notifications each time the app enters foreground for my own reasons…)

Thanks!!

  • 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-18T08:07:02+00:00Added an answer on May 18, 2026 at 8:07 am

    Yes this can be done, I do it all the time:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Add the navigation controller's view to the window and display.
        [NSThread detachNewThreadSelector:@selector(scheduleLocalNotifications) toTarget:self withObject:nil];
        [window addSubview:navigationController.view];
        [window makeKeyAndVisible];
    
        return YES;
    }
    
    -(void) scheduleLocalNotifications
    {
    
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
        for (int i = 0; i < 60; i++)
        {
            UILocalNotification *localNotif = [[UILocalNotification alloc] init];
            if (localNotif == nil)
                return;
            NSDate *sleepDate = [[NSDate date] dateByAddingTimeInterval:i * 60];
            NSLog(@"Sleepdate is: %@", sleepDate);
    
            localNotif.fireDate = sleepDate;    
    
            NSLog(@"fireDate is %@",localNotif.fireDate);
            localNotif.timeZone = [NSTimeZone defaultTimeZone];
            localNotif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"This is local notification %i"), i];
    
            localNotif.alertAction = NSLocalizedString(@"View Details", nil);
            localNotif.soundName = UILocalNotificationDefaultSoundName;
            localNotif.applicationIconBadgeNumber = 1;
    
            [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
            NSLog(@"scheduledLocalNotifications are %@", [[UIApplication sharedApplication] scheduledLocalNotifications]);
            [localNotif release];
    
        }
    
        [pool release];
    }
    

    Taken from a project I am working on now, I can confirm that It works as expected.

    EDIT:
    Example was leaking in scheduleLocalNotifications because handling the NSAutoreleasePool was missing – now it’s added to the example.

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

Sidebar

Related Questions

I need to know is it possible to reserve or lock money with First
Very direct question, i need to know if its possible and maybe where to
To be more precise, I need to know whether (and if possible, how) I
I need to do something I don't even know if is possible.. We have
I don't know if its possible or not, but here's what I need. I'm
Possible Duplicate: Why XML-Serializable class need a parameterless constructor Does anyone know if it
I need to create a thread in Delphi with the following characteristics: Waits until
I know it is not possible to create Mercurial repositories remotely using HTTP(S), for
Does anyone know whether it is possible to create a UDDT that is something
Possible Duplicate: Javascript Regexp dynamic generation? I am trying to create a new RegExp

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.