i am New to iphone Development .I Am Trying To Use NslocalNotification In My Project I Need To Give Remeinder For Every 2Hours or For Every Two Days Or For Every Two Months Etc..Currently I am Using NslocalNotification Repeat Interval .But Its Working For Only Every Minute For Every Hour using 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 If result is 2 depend Up on IntervalType I Need Notification its Not Working With Me
if([InterValType isEqualToString:@"days"]){
notification.repeatInterval=result*24*60*60;
}
@Srinivas:
If you look at the link I have posted in this answer, You will come to know that I have tried every possible solution here to try and do what you want currently.
I had tried all this to implement it in my app, but this doesn't work.
I am afraid to say this but this is not possible. It only allows the unit NSCalendarUnit objects to be set as a repeat interval.
I invested almost 2 months (I asked the question in Dec 2010 and answered it myself in February 2011) to try and implement every possible solution available on internet through different articles and different forums but none did help.
Check out my link and lookout for all the answers if something is useful to you.
How to set Local Notification repeat interval to custom time interval?
Really Hope that this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With