我想在每天上午8:00连续30天安排UILocalNotificaion,我想仅使用一个UILocationNotification实例来实现该功能.这是我安排本地通知的代码.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"HH:mm"];
NSDate *date = [[NSDate alloc] init];
date = [formatter dateFromString:@"08:00"];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = date;
localNotification.timeZone=[NSTimeZone defaultTimeZone];
localNotification.alertBody = @"You just received a local notification";
localNotification.alertAction = @"View Details";
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.repeatInterval = NSDayCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[formatter release];
[date release];
Run Code Online (Sandbox Code Playgroud)
它将在上午08:00永远发出每日通知,但我希望仅连续30天收到通知.最简单的解决方案是启动30个UILocalNotifications,但我希望使用1个UILocalNotification实例执行此操作.我怎样才能做到这一点?请帮忙.
我正在尝试在phonegap中创建一个应用程序.我已经制作了一个custom.js javascript文件,其中包含一些函数
function func1(){....}
function func2(){....}
Run Code Online (Sandbox Code Playgroud)
所有这些功能都将用于两个不同的html页面.在第一个HTML页面中,我在func1中使用了一个变量,它正在进行一些操作.在第二页中,我想在func2中以func1的状态访问它.但我无法做到.我在两个html页面中都包含custom.js. 我已经读过,当在多个页面中使用时,javascript文件会被重置/刷新.任何人都可以给我一个例子,说明如何在func1中保存变量的状态,然后在func1的状态下访问func2中的变量(在不同的HTML页面中).我也读过有关视图状态的内容.但它对我来说都不起作用.请帮忙...