Non-hand party, would like to implement a periodic clock, seek the guidance of some of the great God
They have achieved a simple alarm clock, but not too many ideas for the realization of a periodic clock. Great God seeking guidance on January Reply: You said periodic clock is not possible to set from Monday to Sunday? Then you get the current day of the week can be ah Reply: The server then threw after finishing the next time push data to the client in response to the alarm ........ push data may be delayed ..... Reply:
Ah know. I would like to ask, is there a packaged function, you can get the current day of the week. Use do not have to write it? Reply:
Ah, but feel no need to push to the server. Just get hold of the local fine. In fact, I am not saying that knowledge really understand the server, just started learning ios development. Reply:
With NSDate function to obtain or use some third-party open-source framework ..... But if you are a novice or recommendations to achieve this on your own familiarity is helpful because ios ios does not have the background to be functional ... So best server push .... Reply:
After setting and then threw the server after the next time push data to the client in response to the alarm ........ push data may be a delay .....
Ah, but feel no need to push to the server. Just get hold of the local fine. In fact, I am not saying that knowledge really understand the server, just started learning ios development.
With NSDate function to obtain or use some third-party open-source framework ..... But if you are a novice or recommendations to achieve this on your own familiarity is helpful because ios ios does not have the background to be functional ... So best server push ....
Ah, with the uilocalnotification not? Reply: Looks really really just checked ..... hee hee
The main code: 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]; / / Get the system time -------------------------------------------- , and one assigned to the variable ---------------------
No comments:
Post a Comment