ios本地添加提醒事件
来源:互联网 发布:linux vncviewer使用 编辑:程序博客网 时间:2024/06/06 04:46
多说无益,看代码:
/*
* 一个时间点(dateStr)之后的多少秒(period)提醒,提醒内容(title)
*
*/
-(void)useAlarmClock:(NSString*)dateStr andPeriod:(int)period andTitle:(NSString*)title
{
NSDateFormatter *formatter = [[NSDateFormatteralloc] init];
if (dateStr.length>16) {
[formattersetDateFormat:@"yyyy-MM-dd HH:mm:ss"];
}else{
[formattersetDateFormat:@"yyyy-MM-dd HH:mm"];
}
NSDate *date = [formatter dateFromString:dateStr];
UILocalNotification *notification=[[UILocalNotificationalloc] init];
notification.fireDate = [datedateByAddingTimeInterval:period];
notification.timeZone=[NSTimeZonedefaultTimeZone];
notification.soundName =@"ping.caf";
notification.alertBody = [NSStringstringWithFormat:@"%@时间到了!",title];
[[UIApplicationsharedApplication] scheduleLocalNotification:notification];
}
- ios本地添加提醒事件
- ios 添加日历提醒事件
- 添加本地消息提醒
- iOS 添加闹钟和取消提醒(本地通知)
- ios 本地提醒
- iOS日历中给一个事件添加多个提醒
- iOS 日历提醒事件
- iOS本地闹钟提醒实现
- 本地添加及取消日期时间提醒
- iOS开发将App发布的事件直接添加到系统日历提醒事项的封装
- 添加本地通知事件
- IOS下本地消息提醒UILocalNotification
- iOS本地推送实现备忘录闹铃提醒
- Android 弹出系统日历,添加提醒事件
- IOS本地推送即IOS备忘提醒实现
- [ios] UILocalNotification实现本地的闹钟提醒【转】
- iOS本地通知UILocalNotification--重复提醒(周一、周二、周三...)
- Ios开发中UILocalNotification实现本地通知实现提醒功能
- hdu2157 how many ways 矩阵
- 做个“脸皮厚”的人
- JDBC常用类和接口及增删查修
- UIKit之UITableView的详细使用
- onItemClick和onItemLongClick同时触发解决方案
- ios本地添加提醒事件
- MFC自定义资源
- CSS笔记
- 网站性能优化之黄金守则
- android中viewPager双层嵌套问题,子viewpager无法滑动和滑动父级viewpager后子viewpager不显示内容
- oracle索引导致的查询记录为0的案例
- 在Ubuntu上U盘文件只读且无法删除怎么办
- 遇见LEANGOO
- Android WebView与js交互