I made an app that has custom notifications, but I cant remove them no matter what I do.
[[UIApplication sharedApplication] cancelLocalNotification:[idkey objectAtIndex:indexPath.row]];
That is the code I use for removal; If I use all it works. The idkey
is the correct
value, and its a number in a string, @"3"
in this case.
This is a part of the saving function:
-(void) addNewNotificationWithKey:(NSString*)key {
NSLog(@"%@",key);
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [tempFormatter dateFromString:datuminura];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = description1;
notif.alertAction = @"Open";
notif.soundName = UILocalNotificationDefaultSoundName;
Is it right?