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等编程技术的技巧经验分享),若作品对您有帮助,请关注、分享、点赞、收藏、在看、喜欢,您的支持是我们为您提供帮助的最大动力。

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

相关推荐
余生大大3 小时前
关于Safari浏览器在ios<16.3版本不支持正则表达式零宽断言的解决办法
ios·正则表达式·safari
爱分享的程序员4 小时前
前端跨端框架的开发以及IOS和安卓的开发流程和打包上架的详细流程
android·前端·ios
Macle_Chen4 小时前
ios开发中xxx.debug.dylib not found
ios·bug·debug.dylib
WDeLiang19 小时前
Flutter 环境搭建
flutter·ios·visual studio code
lilili啊啊啊1 天前
iOS 应用性能测试工具对比:Xcode Instruments、克魔助手与性能狗
测试工具·ios·iphone·xcode·克魔
264玫瑰资源库2 天前
嘻游电玩三端客户端部署实战:PC + Android + iOS 环境全覆盖教程
android·ios
鸿蒙布道师2 天前
鸿蒙NEXT开发权限工具类(申请授权相关)(ArkTs)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei
鸿蒙布道师2 天前
鸿蒙NEXT开发定位工具类 (WGS-84坐标系)(ArkTs)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei
ghhgy5312 天前
已安装爱思助手和Apple相关驱动,但仍无法有线连接iPhone热点,且网络适配器没有Apple Mobile Device Ethernet,问题解决
ios·iphone
陈皮话梅糖@2 天前
iOS error: some files could not be transferred (code 23) at xxx
ios