Note that there are some explanatory texts on larger screens.

plurals
  1. PONotification in iphone app
    primarykey
    data
    text
    <p>I have read many post of notification but somehow i am going wrong somewhere so that's why i post this question. I want to get daily notification at 9.00 am in my app. I get it properly at 9.00 am with no problem what so ever but the difficulty is that i also get same notification at 2.00 am. I try with following code. Can anyone tell me where i am getting wrong. Or is it problem of ios6. Any kind of help will be appreciated. Thank you. </p> <pre><code> NSString *day =@"9:00 AM"; NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init]autorelease]; [dateFormat setDateFormat:@"hh:mm a"]; //NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"]; //[dateFormat setTimeZone:gmt]; NSDate *today=[dateFormat dateFromString:day]; NSLog(@"string %@ &amp; date %@",day,today); Class cls = NSClassFromString(@"UILocalNotification"); if (cls != nil) { // delObj.QCouter=delObj.QCouter+1; //[[UIApplication sharedApplication] cancelAllLocalNotifications]; notif = [[cls alloc] init]; notif.fireDate =today; notif.timeZone = [NSTimeZone systemTimeZone]; NSLog(@"timeZone %@ ",[NSTimeZone systemTimeZone]); notif.alertBody = @"You have a new letter "; notif.alertAction = NSLocalizedString(@"View", nil);; notif.soundName = @"Ding3.wav"; notif.applicationIconBadgeNumber = 1; notif.repeatInterval = NSDayCalendarUnit; [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"Status"]; NSDictionary *userDict = [NSDictionary dictionaryWithObject:@"You have a notifiaction" forKey:kRemindMeNotificationDataKey]; notif.userInfo = userDict; // NSLog(@"userInfo %@",notif.userInfo); [[UIApplication sharedApplication] scheduleLocalNotification:notif]; [notif release]; [[NSUserDefaults standardUserDefaults] setObject:@"CurrentDay" forKey:@"DayChange"]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload