ios CCUILocalNotification.m

objectivec 复制代码
//
//  CCUILocalNotification.h
//  CCFC
//
//


#import <Foundation/Foundation.h>




@interface UILocalNotification(cc)


// create a common local notification
+ (UILocalNotification *)createCommonNotification:(NSString *)alertBody 
                                                                                 withTime:(NSTimeInterval)fireSeconds;




@end
objectivec 复制代码
//
//  CCUILocalNotification.m
//  CCFC
//
//


#import "CCUILocalNotification.h"




@implementation UILocalNotification(cc)


// create a common local notification
+ (UILocalNotification *)createCommonNotification:(NSString *)alertBody withTime:(NSTimeInterval)fireSeconds
{
        UILocalNotification *noti = [[UILocalNotification alloc] init];
        if(noti != nil) 
        {
                NSDate *now = [NSDate date];
                noti.fireDate = [now dateByAddingTimeInterval:fireSeconds];
                noti.timeZone = [NSTimeZone defaultTimeZone];
                noti.alertBody = alertBody;
                [[UIApplication sharedApplication] scheduleLocalNotification:noti];     
        }
        [noti release];
        
        return noti;
}


@end

微风不燥,阳光正好,你就像风一样经过这里,愿你停留的片刻温暖舒心。

我是程序员小迷(致力于C、C++、Java、Kotlin、Android、iOS、Shell、JavaScript、TypeScript、Python等编程技术的技巧经验分享),若作品对您有帮助,请关注、分享、点赞、收藏、在看、喜欢,您的支持是我们为您提供帮助的最大动力。

欢迎关注。助您在编程路上越走越好!

相关推荐
忆江南1 小时前
iOS 深度解析
flutter·ios
没有故事的Zhang同学1 小时前
05-主题|事件响应者链@iOS-应用场景与进阶实践
ios
FeliksLv9 小时前
尝试给Lookin 支持 MCP
ios
没有故事的Zhang同学9 小时前
01-研究系统框架@Web@iOS | JavaScriptCore 框架:从使用到原理解析
ios
CocoaKier2 天前
苹果谷歌商店:如何监控并维护用户评分评论
ios·google·apple
iOS日常2 天前
iOS设备崩溃日志获取与查看
ios·xcode
wangruofeng2 天前
AI 助力 Flutter 3.27 升级到 3.38 完整指南:两周踩坑与实战复盘
flutter·ios·ai编程
iOS日常3 天前
Xcode 垃圾清理
ios·xcode
开心就好20253 天前
不越狱能抓到 HTTPS 吗?在未越狱 iPhone 上抓取 HTTPS
后端·ios
傅里叶3 天前
iOS相机权限获取
flutter·ios