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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:41:25+00:00 2026-05-20T12:41:25+00:00

I am having an app in which I have to schedule Local Notifications. Consider

  • 0

I am having an app in which I have to schedule Local Notifications. Consider a user enters the time 7 AM, then the Notification has to be fired on 7 AM every day (or, ever 2 days, or every 3 days) based on the settings he set. This Notification has to be fired on regular basis until the user turns of the Notification.

My doubt is how to schedule the Notification to fire on every 2 days or every 3 days or every 2 weeks like that? Sorry if this is a very basic question. I am new to Local Notifications.

  • 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-20T12:41:26+00:00Added an answer on May 20, 2026 at 12:41 pm

    What you need you need to make a date list from a start date to end date then need to enter a gap in days for alarms and according to that gap you need to set alarms.

    date with time is required for alarms.

    see this function this return an array of dates with gap in days

    -(NSMutableArray *)getDatesArrayBetweenDates:(NSString *)minDate toDate:(NSString *)maxDate freqDays:(NSInteger )dayfreq
    {
        // minDate and maxDate represent your date range
        NSMutableArray *resultArray=[NSMutableArray array];
        NSCalendar *gregorianCalendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
        NSDateComponents *days = [[NSDateComponents alloc] init];
        NSDate *minDateObject;
        NSDate *maxDateObject;
        NSDateFormatter *df=[[NSDateFormatter alloc] init];
        [df setDateFormat:@"MM/dd/yyyy"];
        minDateObject=[df dateFromString:minDate];
        maxDateObject=[df dateFromString:maxDate];
        NSInteger dayCount = 0;
        while ( TRUE ) {
    
            NSDate *date = [gregorianCalendar dateByAddingComponents: days toDate: minDateObject options: 0];
            [days setDay: ++dayCount];
            if ( [date compare: maxDateObject] == NSOrderedDescending )
                break;
            // Do something with date like add it to an array, etc.
            NSString *dateForAdd=[df stringFromDate:date];
            //if(![self.dateListArray containsObject:dateForAdd])
                [resultArray addObject:dateForAdd];
        }
        [df release];
        [days release];
        [gregorianCalendar release];
    
        NSMutableArray *returnableArray=[NSMutableArray array];
        NSInteger day=0;
        for(int i=0;i<[resultArray count];i++)
        {
           if(day==0)
           {
               [returnableArray addObject:[resultArray objectAtIndex:i]];
           }
    
            if(day==dayfreq)
                day=0;
            else {
                ++day;
            }
    
        }
        return returnableArray;
    }
    

    what you need to pass a start date and end date in string and the days gap for alarm and this function returns you a array of dates in strings.Now you need to use these date and append your time then make date object by NSDateFormatter then set it for fireDate of local notification.

    see this link for more info

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

Sidebar

Related Questions

I have an asp.net mvc app which has membership implemented. So a user has
I have an IPhone application which is having a non consumable in app purchse
I have an app which has to load some data at startup, so I
I have an app which runs fine as a simple WPF app having an
I am having an app which tracks the Geopoints of the user. I simply
I m working on an app in which i have 5 buttons(having .png images
I have a web app in which I have set the maximum inactivity time
I have an app which user can login using twitter and facebook to login,
I have an application in which the user can select from local video files.
I'm scratching my head over this. I have a moderately successful app which has

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.