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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:23:37+00:00 2026-05-25T22:23:37+00:00

I am saving my date selected from datepicker in nuserdefaults. When I select the

  • 0

I am saving my date selected from datepicker in nuserdefaults. When I select the date from date picker say 9.52 AM and click on the save button the date selected is getting saved in userdefaults and in SQLite. If I select another date to set another alarm say 9.54 AM and click on the save button, both the dates are getting saved in SQLite but the problem is the earlier 9.52 date is getting overrided by 9.54 in nsuserdefaults and so the notification for the last added date in userdefaults is shown.

I want that if I select 9.52AM and then click save and then select 9.54 AM and click save both the time should be saved in userdefaults and the notification for 9.52AM should be shown first.

  • 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-25T22:23:38+00:00Added an answer on May 25, 2026 at 10:23 pm

    I think you add date objects to array and than add to NSUserDefaults

    if ([[NSUserDefaults standardUserDefaults] valueForKey:@"date"]==nil)
    {
        [[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:@"date"];
        [[NSUserDefaults standardUserDefaults] synchronize];
        NSLog(@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"date"]);
    }
    else
    {
        NSArray *array = [[NSUserDefaults standardUserDefaults] objectForKey:@"date"];
        NSMutableArray *array_dates = [[NSMutableArray alloc] init];
        for(int i =0;i<[array count];i++)
        {
            [array_dates addObject:[array objectAtIndex:i]];
        }
        [array_dates addObject:YourpresentdateObject];
        [[NSUserDefaults standardUserDefaults] setObject:array_dates forKey:@"date"];
        [[NSUserDefaults standardUserDefaults] synchronize];
        NSLog(@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"date"]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using datepicker from jQuery. Once selected, I want it to display as
Is there a way in Oracle to select the date on which daylight savings
Possible Duplicate: How can I subtract a day from a python date? I have
I have trouble saving my date field into database using CakePHP. Table column name
I have a a field in my database saving a date as DateTime. I
I'm using Jade to render my views from within Express.js. I am saving documents
How to identify if a date is in daylight saving time zone or not
Hi in my table i am saving the date as '2010-12-01' i,e but i
I have some real issues with display and saving a date. Its setup in
I'm in a dilemma about saving date and time values in MySQL's TIMESTAMP format

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.