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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:15:30+00:00 2026-06-05T08:15:30+00:00

I want to cancel an iOS local notification after a particular time. For example

  • 0

I want to cancel an iOS local notification after a particular time.

For example : a week later

- (void)ViewDidLoad
{
    NSDate *date = [NSdate date];
    UILocalNotification *localNotif = [[UILocalNotification alloc] init];
    //set some localNotif's properties
    localNotif.repeatInterval = NSDayCalendarUnit;
    localNotif.fireDate = date

    [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
}

How can I cancel localNotif after a week (7 days) and can you show me the code?

  • 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-05T08:15:31+00:00Added an answer on June 5, 2026 at 8:15 am

    You can’t do that unless your app is running in the foreground at the time the notification is due to be cancelled (in which case there would be no need to cancel it anyway).

    The reason you can’t do it is because you would need a timer to tell you when to cancel it, and you can’t schedule a timer unless you are an app that has a background mode, in which case you could schedule a timer to notify you – but even background apps can be suspended still it would not be guaranteed.

    See here
    iOS Run Code Once a Day

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

Sidebar

Related Questions

Currently I have a timer with an alarm (local notification). I want to create
I want to cancel the Context Menu Opened Event of a TreeViewItem private void
I want to inject a confirmation dialog to allow the user to cancel the
I want to change the title of the search bar cancel button to Offers
I have several thread pools and I want my application to handle a cancel
I'm new to iOS developement... I want to add 3 buttons on this view:
I want to cancel an event from within that function scope. Eg. I pressed
On some condition I want to cancel onmousemove event when mouse goes down, for
I'm submitting a form with JS and I want to cancel the submit if
Normally, when I want to cancel a backgroundWorker in C# I will do something

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.