iphone - UILocalnotification firing even after notification is cancelled -


the notification firing after cancelled. tried checking cancelling method turned out correct.

when cancel notification, notification again fired next day

- (void)cancelnotification:(int)bookid {     nsarray *notifications = [[uiapplication sharedapplication] scheduledlocalnotifications];     nslog(@"cancelling... before %d",[[[uiapplication sharedapplication]scheduledlocalnotifications]count]);      (uilocalnotification *notification in notifications)     {          int notifremedyid = [[notification.userinfo objectforkey:@"kremindmenotificationremedyidkey"]intvalue];          nslog(@"remedyid  : %d",remedyid);         nslog(@"notifyid : %d",notifremedyid);         if (remedyid == notifremedyid)         {             [[uiapplication sharedapplication] cancellocalnotification:notification];         }      }  } 

i thinking because of repeatinterval.should repeatinterval property removed.

so wanted know going wrong.

1) first check retrieved particular notification object not nil. check if notification want cancel.

2) when sure notification object not nil , notification desired one, fire below command. notification desired notification object.

[[uiapplication sharedapplication] cancellocalnotification:notification]; 

3) looking @ code , see not using bookid notification anywhere in code. not sure if using code anymore.

4) no, don't need cancel repeating notification

note: please update question final updated code. looks confusing.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -