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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:47:34+00:00 2026-06-11T14:47:34+00:00

I have prepared an Alarm Clock app which uses UILocalnotification for scheduling the alarm.Now

  • 0

I have prepared an Alarm Clock app which uses UILocalnotification for scheduling the alarm.Now after the alarm has been set, I want to make a switch so that I can turn it ON and OFF usingUISwitch.I just cant figure how can I do that?What I am thinking as of now is that when you switch OFF the alarm, I shall store the DATE and TIME value before canceling the UILocalnotification so that when the user again switch ON the alarm I reschedule it with the stored DATE and TIME values. Is it the right way to do or is there any other ways to do that?

  • 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-11T14:47:35+00:00Added an answer on June 11, 2026 at 2:47 pm

    just make the database table which have ‘date’, ‘isCanceled’ field and unique id ‘alarmId’ columns (use rest whatever you want). so when the user wants to cancel the alarm try this,

        NSString *alarmId = @"some_id_to_cancel"; 
        UILocalNotification *notificationToCancel=nil;            
        for(UILocalNotification *aNotif in [[UIApplication sharedApplication] scheduledLocalNotifications]) {
            if([aNotif.userInfo objectForKey:@"ID"] isEqualToString:alarmId]) { 
                notificationToCancel = aNotif; 
                break; 
            } 
        } 
        [[UIApplication sharedApplication] cancelLocalNotification:notificationToCancel];
    

    to use this better you create your alarm by,

    UILocalNotification *localNotif = [[UILocalNotification alloc] init]; 
    
     if (localNotif == nil)  
      return;
    
     localNotif.fireDate = itemDate; 
     localNotif.timeZone = [NSTimeZone defaultTimeZone];
     localNotif.alertAction = NSLocalizedString(@"View Details", nil); 
     localNotif.alertBody = title;
     localNotif.soundName = UILocalNotificationDefaultSoundName; 
    
     NSDictionary *infoDict = [NSDictionary dictionaryWithObject:stringID forKey:@"ID"]; 
     localNotif.userInfo = infoDict; 
    
     [[UIApplication sharedApplication] scheduleLocalNotification:localNotif]; 
     [localNotif release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have prepared a disk image with my application,which i want to install in
I have a problem with initializing my app properly after the autostart. I've managed
I think I found a bug for which I have prepared a small test
I have a base class line which has a child class arc (note that
I am using primefaces 3.2. I have prepared wizard which insert user information on
I am new to phonegap. I have prepared one sample application. My application has
I have prepared a screen in which I am allowing user to create an
Hi i have prepared a windows service which setup on server by batch file
I have successfully submitted and got approved my app in the app store. Now
I have prepared an installer which will deploy some files as well as will

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.