iphone-common-codes-ccteam源代码 CCUILocalNotification.m

//  
// CCUILocalNotification.m
// CCFC
//
// Created by xichen on 11-12-24.
// Copyright 2011 ccteam. All rights reserved.
//


#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

 

可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCUILocalNotification.m

github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCUILocalNotification.m

 

posted @ 2012-01-10 09:48  cc_team  阅读(146)  评论(0编辑  收藏  举报