UILocalNotification 如何实现闹铃
2个回答
2013-07-18
展开全部
UILocalNotification *newNotification = [[UILocalNotification alloc] init]; if (newNotification) { newNotification.fireDate = newFireDate; newNotification.alertBody = clockRemember; newNotification.soundName = [NSString stringWithFormat:@"%@.caf", clockMusic]; newNotification.alertAction = @"查看闹钟"; newNotification.repeatInterval = NSWeekCalendarUnit; NSDictionary *userInfo = [NSDictionary dictionaryWithObject:clockID forKey:@"ActivityClock"]; newNotification.userInfo = userInfo; [[UIApplication sharedApplication] scheduleLocalNotification:newNotification]; }
2013-07-18
展开全部
我这个在真机4,4s上是可以的,在5上没测试过,你可以试试看。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询