【发布时间】:2011-08-09 05:32:49
【问题描述】:
我是 iphone 开发的新手。我正在尝试在我的项目中使用 NslocalNotification 我需要每 2 小时或每两天或每两个月等进行提醒。目前我正在使用 NslocalNotification 重复间隔。但它使用 Nscalender 每小时只工作一分钟 ....
NSString *InterVal=[freQuencyArr objectAtIndex:index-2];
NSString *InterValType=[freQuencyArr objectAtIndex:index-1];
if(![InterVal isEqualToString:@"Every"])
{
result=[InterVal intValue];
}else
result=1;
if([InterValType isEqualToString:@"Day"]){
notification.repeatInterval= NSDayCalendarUnit;
}else if([InterValType isEqualToString:@"Week"]){
notification.repeatInterval= NSWeekCalendarUnit;
}
else if([InterValType isEqualToString:@"Month"]){
notification.repeatInterval= NSMonthCalendarUnit;
}else if([InterValType isEqualToString:@"days"]){
notification.repeatInterval=result*24*60*60;
}
here 如果结果为 2,则取决于 IntervalType 我需要通知 它不和我一起工作
if([InterValType isEqualToString:@"days"]){
notification.repeatInterval=result*24*60*60;
}
【问题讨论】:
-
我的回答对您有帮助吗?
标签: iphone objective-c nsnotifications nsnotificationcenter