啊 ,但是感觉没有必要推送到服务器。只弄个本地的就好了。话说其实我也不是很懂服务器的知识,刚刚开始学习ios开发。
解决方案 »
- 基础问题
- 想自学IPHONE开发,请大家推荐几本入门的书。
- 问个通讯录的问题
- 请问我想开发一个Iphone4和Iphone4S都能看到的很简单的一个新闻游览程序,应该学些什么东西,谢谢
- 把安卓平台的应用软件移到苹果平台上用,有人能做吗?请联系我!
- BigBoss源更新以后直接安全模式问题
- Presenting view controllers on detached view controllers is discouraged 警告
- 网络数据解析问题
- iOS 拿到一帧一帧的 g711u音频数据和h264视频数据 怎么合成一个视频文件?
- 求ios播放原始http超大视频文件方案
- 求网易新闻中的导航实现方法
- 用OC怎么实现图书销售系统,
啊 ,但是感觉没有必要推送到服务器。只弄个本地的就好了。话说其实我也不是很懂服务器的知识,刚刚开始学习ios开发。用NSDate的函数来获取 或者用一些开源的第三方框架.....但是建议你如果是新手还是自己去实现这块 对你熟悉ios是有帮助的 因为ios本身没有后台待的功能....所以最好是服务器推送....
啊 ,但是感觉没有必要推送到服务器。只弄个本地的就好了。话说其实我也不是很懂服务器的知识,刚刚开始学习ios开发。用NSDate的函数来获取 或者用一些开源的第三方框架.....但是建议你如果是新手还是自己去实现这块 对你熟悉ios是有帮助的 因为ios本身没有后台待的功能....所以最好是服务器推送....
嗯,用uilocalnotification不可以吗?
主要代码:
NSDate* now = [NSDate date];
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *comps = [[NSDateComponents alloc] init];
NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit |
NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
comps = [calendar components:unitFlags fromDate:now];
int hour = [comps hour];
int min = [comps minute];
int sec = [comps second];
//--------------------------------------------取得系统的时间,并将其一个个赋值给变量---------------------代码二:UILocalNotification *notification=[[UILocalNotification alloc] init];
if (notification!=nil)
{ NSDate *now=[NSDate new];
notification.fireDate=[now addTimeInterval:hm]; //设置响应时间,单位 秒
NSLog(@"%d",hm);
notification.timeZone=[NSTimeZone defaultTimeZone];
notification.soundName = @"ping.caf"; //加入声音
//notification.alertBody=@"TIME!";
notification.alertBody = [NSString stringWithFormat:NSLocalizedString(@"你设置的时间是:%i : %i .",nil),htime1,mtime1]; //弹出对话框 [[UIApplication sharedApplication] scheduleLocalNotification:notification];
}