Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try this it's work in my application :</p> <pre><code>-(IBAction)setRemind:(id)sender{ NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar]; NSDateFormatter *dateFormatter2 = [[NSDateFormatter alloc] init]; [dateFormatter2 setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; //Gets our picker NSDate *selectedTime = [datePicker date]; strDate2 = [dateFormatter2 stringFromDate:selectedTime]; NSDate *Date=[dateFormatter2 dateFromString:strDate2]; NSDateComponents *dateComponents = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit ) fromDate:Date]; // Set up the fire time NSDateComponents *dateComp = [[NSDateComponents alloc] init]; [dateComp setDay:[dateComponents day]]; [dateComp setMonth:[dateComponents month]]; [dateComp setYear:[dateComponents year]]; [dateComp setHour:9]; [dateComp setMinute:00]; [dateComp setSecond:00]; [dateComp release]; NSDate *date = [calendar dateFromComponents:dateComp]; [self scheduleAlarmForDate:date message:txtDescri.text]; } -(IBAction)scheduleAlarmForDate:(NSDate*)date message:(NSString*)msg { //====== TO SEE OLD NOTIFI======= UIApplication *Ap = [UIApplication sharedApplication]; NSArray *arr = [Ap scheduledLocalNotifications]; NSLog(@"Old Notifications :&gt;&gt; %@",arr); UIApplication* app = [UIApplication sharedApplication]; UILocalNotification *alarm = [[UILocalNotification alloc] init]; // Create a new notification alarm.fireDate = date; NSLog(@"fireDate IS &gt;&gt; %@", alarm.fireDate); alarm.timeZone = [NSTimeZone localTimeZone]; alarm.alertBody = msg; NSLog(@"msg IS &gt;&gt; %@",msg); alarm.alertAction = @"Show"; alarm.repeatInterval = 0; alarm.soundName = UILocalNotificationDefaultSoundName; alarm.applicationIconBadgeNumber = 1; [app scheduleLocalNotification:alarm]; [alarm release]; } </code></pre> <p>i Hope it's helpful to you. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload