title: How do you set applicationIconBadgeNumber with scheduleLocalNotification?
body: <p>I am having some difficulties setting the icon badge with a schedule local notification for my ios application.</p>
  
  <p>I am able to trigger a local notification pop up after 10 seconds when I click the home screen after loading the application. However, the application icon badge number is not getting set. I am using the following code. </p>
  
  <pre><code>UILocalNotification *localNotif = [[UILocalNotification alloc] init];
  if (localNotif == nil) return;
  NSDate *fireTime = [[NSDate date] addTimeInterval:10]; // adds 10 secs
  localNotif.fireDate = fireTime;
  localNotif.alertBody = @"New Message!";
  localNotif.applicationIconBadgeNumber = 1;
  [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
  </code></pre>
  
  <p>I don't understand why the local notification pops up but the applicationIconBadgeNumber doesn't get set. I am able to set the icon badge number manually by executing the following code instead.</p>
  
  <pre><code>[UIApplication sharedApplication].applicationIconBadgeNumber = 1;
  </code></pre>