1天学习1个类库 UILocalNotification 示例
来源:互联网 发布:合肥程序员平均工资 编辑:程序博客网 时间:2024/06/06 20:00
直接发代码:
//// main.m// ControlDemo//// Created by watsy0007 on 12-6-3.// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.//#import <UIKit/UIKit.h>#import <Social/Social.h>#define BARBUTTONITEM(bar,title,act) UIBarButtonItem *bar = [[UIBarButtonItem alloc] initWithTitle:title \style:UIBarButtonItemStylePlain \target:self \action:act];@interface ViewController : UIViewController {}@end@implementation ViewController- (void) dealloc { [super dealloc];}- (void) loadView { [super loadView]; [[self view] setBackgroundColor:[UIColor whiteColor]];}- (void) viewDidLoad { [super viewDidLoad]; UILocalNotification *noti = [[UILocalNotification alloc] init]; noti.fireDate = [NSDate dateWithTimeIntervalSinceNow:10]; noti.timeZone = [NSTimeZone defaultTimeZone]; noti.repeatInterval=NSCalendarCalendarUnit; noti.repeatInterval = NSDayCalendarUnit; noti.alertBody = @"xxxxxxxxxxxx"; noti.alertAction = @"本地通知Demo"; noti.soundName = UILocalNotificationDefaultSoundName; noti.alertLaunchImage = @"alertLaunchImage"; [[UIApplication sharedApplication] scheduleLocalNotification:noti]; [noti release];}- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { return YES;}@end//-----------------------------------------------------------------------------------------------------#pragma mark -#pragma mark AppDelegate@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) UIViewController *viewController;@end@implementation AppDelegate@synthesize window = _window;@synthesize viewController = _viewController;- (void) dealloc { [_window release]; [_viewController release]; [super dealloc];}- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { srand(time(NULL)); self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; self.viewController = [[ViewController alloc] init]; UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:self.viewController]; self.window.rootViewController = controller; [controller release]; [self.window makeKeyAndVisible]; return YES;}@endint main(int argc, char *argv[]){ @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); }}
- 1天学习1个类库 UILocalNotification 示例
- SWIFT推送之本地推送(UILocalNotification)-1
- UILocalNotification
- UILocalNotification
- UILocalNotification
- UILocalNotification
- UILocalNotification
- SQLLoader学习示例1
- 1天学习1个类库 UIMapView annomation 示例
- 1天学习1个类库 MKMapView Overlay示例
- 1天学习1个类库 磁场方向 CLHeading 示例
- 【iOS学习笔记】本地通知 UILocalNotification
- Python学习(1)----教材示例
- css示例学习---文字特效1
- webservice学习代码示例(1)
- 1天学习1个类 UIBarButtomItem 类 示例
- 1天学习1个类 UIButton 类 示例
- 1天学习1个类 UIDatePicker 类 示例
- 写BOKE有积分吗?
- 理解inode
- 进程的内核对象句柄表
- 正则表达式---小节(一)
- [转载]Flex开源项目
- 1天学习1个类库 UILocalNotification 示例
- [转载]Flex开源项目
- jQuery对于动态生成的内容的控制
- 如何在嵌入式LINUX中添加ARM开机图片?
- C#写unity3d的脚本需要注意
- Google应用在Android上的Push机制以及C2DM框架的底层实现
- GMF中,如何给节点的输入和输出赋值
- VC++6.0中拖曳文件到文本框得到文件名(OnDropFiles)
- java基础语法学习笔记(四)