Finally I found a solution for this.
….>In appdelegate
(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Reminder"
message:notification.alertBody
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
// Request to reload table view data
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification" object:self];
}
….>create reminder-SecondClass(Save Action)
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = pickerDate;
localNotification.alertBody = self.EventText.text;
localNotification.soundName=UILocalNotificationDefaultSoundName;
localNotification.alertAction = @"Show me the item";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] +1;
NSUserDefaults *Defaults=[NSUserDefaults standardUserDefaults];
[Defaults setObject:dateString forKey:@"eventdate"];
NSLog(@"Datepicker Date..%@",dateString);
[Defaults synchronize];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
// Request to reload table view data
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification" object:self];
// Dismiss the view controller
[self.navigationController popViewControllerAnimated:YES];
//First Class
—>viewDidLoad
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadTable)
name:@"Notification"
object:nil];
cellForRowAtIndexPath
UILocalNotification *localNotification = [AlarmArray objectAtIndex:indexPath.row];
// Display notification info
[cell.EventText setText:localNotification.alertBody];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat: @"dd-MM-yyyy"];
DateString=[dateFormat stringFromDate:localNotification.fireDate];
[dateFormat setDateFormat:@"h:mm a"];
NSString *TimeString=[dateFormat stringFromDate:localNotification.fireDate];
[cell.TimeLabel setText:[TimeString description]];
NSLog(@"Datepicker Date..%@",DateString);
[cell.EventDate setText:[DateString description]];
So it works finely.
solved EKCalendar on my ipad application