简体   繁体   中英

How to send notification using multiple time intervals in iphone?

I have time intervals in MutableArray like

NSMutableArray *times=[[NSMutableArray alloc]initWithObjects:@"6:00 AM", @"6:15 AM", @"6.30 AM", @"6:45 AM", nil];

Now i want to display notifications , when iphone local system time matches to that MutableArray time intervals notification has to display at every intervals. Please help me in this problem and send me the code. Thank you in advance.

I guess there is no straight forward way to identify it.

You just need to write a logic on this like first get system's current time and match it with your mutable array and check for the time difference between first time array(Or array which is very close to system time)these two and put up a notification after that time difference change. Then there you go now you can identify when the array time and system time matches.

You can use repeatInterval to repeat the notification. Try like this..

localNotification.repeatInterval=NSMinuteCalendarUnit;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM