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

  • Home
  • SEARCH
  • 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 8088727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:10:22+00:00 2026-06-05T19:10:22+00:00

Previously, I have worked on local notifications, but I got problem in it now.

  • 0

Previously, I have worked on local notifications, but I got problem in it now. Suppose today, I have to set a notification for 1 day before date : 07/07/2012 in my app. How can I will be able to do that. I’m setting notification like this..

- (IBAction) scheduleNotification:(id) sender {

    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    NSDateFormatter *formatter = [[[NSDateFormatter alloc]init]autorelease];

    for (int i = 0; i< [delegate.viewController.contactList count] ; i++) {
        UILocalNotification *localNotification = [prototypeNotification copy];
        NSString *name = [[delegate.viewController.contactList objectAtIndex:i]objectForKey:NAME_KEY];
        NSString *birthday = [[delegate.viewController.contactList objectAtIndex:i]objectForKey:BIRTHDAY_KEY];
        if (birthday) {
            [formatter setDateFormat:@"MM/dd/yyyy"];
            NSDate *date = [formatter dateFromString:birthday];
            if (date == nil) {
                [formatter setDateFormat:@"MM/dd"];
                NSDate *date = [formatter dateFromString:birthday];
            }
            else {

            }
            self.alarmTime = [date dateByAddingTimeInterval:10];
            localNotification.fireDate = alarmTime;
            localNotification.timeZone = [NSTimeZone defaultTimeZone];
            localNotification.applicationIconBadgeNumber = 1;

            NSString *itemName = @"B'day Alert!!!";
            NSString *msgName = [NSString stringWithFormat:@"Celebrate %@'s B'day",name];
            NSDictionary *userDict = [NSDictionary dictionaryWithObjectsAndKeys:itemName,MessageKey, msgName,TitleKey, nil];
            localNotification.userInfo = userDict;
            localNotification.soundName = self.soundName;
            // Schedule the notification
            [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

        }

        else {
//            write else part
        }
        [localNotification release];
    }

}

When I encounter NSDate *date = [formatter dateFromString:birthday]; this line , date is not coming accurately,so I’m not able to set local notification properly. If any thing m doing wrong please, help me out.

  • 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-05T19:10:23+00:00Added an answer on June 5, 2026 at 7:10 pm

    NSDateFormatter has a different behavior than that of you would think. If you’re confused whether it uses GMT, UTC, the time zone based of our current system locale or something else, read this question and answer: NSDateFormatter return incorrect date from string

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

Sidebar

Related Questions

Previously I've worked alone... Now I may have many collaborators. But I don't want
Previously I have only really worked on applications, but now I am trying to
Friends, Previously I have worked with EJB-WEBSTART CLIENT project, and Now i have joined
Previously i have used oracle 10g version . but today i uninstalled oracle 10g
I have previously really only worked on your general 3-tier system. I am now
I have previously worked with Raphael, but I have returned to my project and
I have a Drupal installation that previously worked perfectly on my localhost. However, now,
Well, I'm relatively new to php but have worked on web apps previously. I'm
I am new to MVC .NET (I have previously worked on Ruby On Rails).
I'm trying to get started with Django, and have previously worked with CakePHP, and

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.