Skip to content

Instantly share code, notes, and snippets.

@pec1985
Created June 11, 2012 17:34
Show Gist options
  • Save pec1985/48a765c50f64aa7c47ed to your computer and use it in GitHub Desktop.
Save pec1985/48a765c50f64aa7c47ed to your computer and use it in GitHub Desktop.
Appcelerator cancelLocalNotifications fixed!!
// line #170
-(void)cancelLocalNotification:(id)args
{
ENSURE_SINGLE_ARG(args,NSObject);
ENSURE_UI_THREAD(cancelLocalNotification,args);
NSArray *notifications = [[UIApplication sharedApplication] scheduledLocalNotifications];
if (notifications!=nil)
{
for (UILocalNotification *notification in notifications)
{
if([[[notification userInfo] objectForKey:@"id"] isEqual:args])
{
[[UIApplication sharedApplication] cancelLocalNotification:notification];
return;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment