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

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

相关推荐
鹏多多.18 分钟前
flutter-使用device_info_plus获取手机设备信息完整指南
android·前端·flutter·ios·数据分析·前端框架
麦兜*15 小时前
【swift】SwiftUI动画卡顿全解:GeometryReader滥用检测与Canvas绘制替代方案
服务器·ios·swiftui·android studio·objective-c·ai编程·swift
GeniuswongAir1 天前
iOS 26 一键登录失效:三大运营商 SDK 无法正常获取手机号
ios
吴Wu涛涛涛涛涛Tao1 天前
Flutter 实现类似抖音/TikTok 的竖向滑动短视频播放器
android·flutter·ios
猪哥帅过吴彦祖1 天前
Flutter 插件工作原理深度解析:从 Dart 到 Native 的完整调用链路
android·flutter·ios
归辞...1 天前
「iOS」————UITableView性能优化
ios·性能优化·cocoa
AI工具测评与分析1 天前
EhViewer安卓ios全版本类下载安装工具的完整路径解析
android·ios
叽哥2 天前
flutter学习第 18 节:设备功能调用
android·flutter·ios
金玉满堂@bj2 天前
OS设备UDID查看方法
macos·objective-c·cocoa