Я хочу получить доступ к Родительскому календарю в своем приложении. В нем упоминается так много ссылок, но до сих пор не удалось выполнить этот процесс. События отображаются в моем календаре. Установка оповещения о времени и дате также используется пользователем. Любое решение для меня очень ценилось.EKCalendar на моем приложении ipad
-19
A
ответ
1
Наконец-то я нашел решение для этого.
....> В 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];
}
....> создать напоминание-SecondClass (Сохранить действие)
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];
// Первый класс
- -> 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]];
Так это работает точно.
Смежные вопросы
- 1. Перетаскивание в моем приложении для iPad
- 2. Как изменить EKSourceType EKCalendar?
- 3. Проверка на нуль в EKCalendar
- 4. Сохранение EKCalendar
- 5. Проверить EKCalendar
- 6. Очень долгое время восстановления на моем приложении
- 7. Как я могу проверить приложение iPad на моем фактическом iPad?
- 8. Как открыть карты google в popover в моем приложении ipad?
- 9. ipad: как я могу определить ipad3 в моем приложении?
- 10. Как открыть .IBA-файл в моем приложении ipad
- 11. Получение источника/имени EKCalendar
- 12. Удаление и повторное создание EKCalendar
- 13. EKCalendar остается в приложении календаря после удаления приложения
- 14. Swift EKCalendar не сохраняющиеся
- 15. @media запросов не работает на моем IPad
- 16. Отладка iPad Safari на моем компьютере
- 17. Duplicatesфотография на моем андроидном приложении
- 18. Переименовать EKCalendar в iOS
- 19. Прошедшие события в EKCalendar
- 20. Как воссоздать анимацию в приложении iPad iPad?
- 21. Инструменты - утечка в приложении iPad
- 22. отключена функция в приложении iPad
- 23. анимация в приложении ipad
- 24. iPad в универсальном приложении на iOS 8
- 25. Ссылка на файлы в приложении iPad
- 26. Создание кнопки в приложении Playground на iPad
- 27. Отключить «Центр уведомлений» на приложении iPad (phonegap)
- 28. Приложение Iphone не отображается на iPad-приложении
- 29. Проблема с импульсной прокруткой на iPad-приложении
- 30. Создание EKCalendar в EKEventStore - Swift
Что вы подразумеваете под «Родным календарем». Вы имеете в виду, что вам нужен календарь, который отображает месяцы и дни недели? –
Ваше заявление о проблеме неясно. – JAL
Используете ли вы быстрый или объективный c? –