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

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

相关推荐
songgeb9 小时前
Concurrency in Swift学习笔记-初识
ios·swift
DY009J9 小时前
C++基础学习——文件操作详解
c++·学习·cocoa·visual studio code
mobsmobs14 小时前
Flutter开发环境搭建与工具链
android·flutter·ios·android studio·xcode
SY.ZHOU16 小时前
iOS上使用WebRTC推拉流的案例
ios·音视频·cocoa·webrtc
杂雾无尘18 小时前
2025 年了,是否该全面拥抱 Swift 6?
ios·swift·客户端
Digitally20 小时前
设置后轻松将 iPhone 转移到 iPhone
ios·iphone
2501_9160074721 小时前
iOS 抓包工具有哪些?2025实用指南与场景推荐
android·ios·小程序·https·uni-app·iphone·webview
ii_best1 天前
[iOS开发工具] 【iOS14以及以下】cydia商店按键精灵iOS新版V2.X安装教程
ios
KanS11 天前
2025真实面试试题分析-iOS客户端开发
ios·面试·职场和发展
归辞...1 天前
「iOS」——RunLoop学习
笔记·学习·ios