Skip to content

sozorogami/NotificationBug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NotificationBug

A sample project demonstrating an iOS8 bug I discussed at this meetup in Tokyo.

It should log four scheduled notifications to the console, but under iOS8, it will usually log three.

Changing the position of the sleep() call as below causes it to behave normally, strongly suggesting that async behavior is to blame.

    while (YES) {
        [[UIApplication sharedApplication] cancelAllLocalNotifications];
        for (NSDate *date in [self dates]) {
            UILocalNotification *notification = [self defaultNotificationWithDate:date];
            [[UIApplication sharedApplication] scheduleLocalNotification:notification];
        }
        sleep(2);
        NSLog(@"Notifications: %@", [UIApplication sharedApplication].scheduledLocalNotifications);
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published