title: Local Notification doesn't work on iOS5
body: <p>After configuring everything in notification center, which allows the app to display the notification, my app's local notification doesn't fire.</p>
  
  <p>Do you encounter the same problem?</p>
  
  <p>more information: </p>
  
  <ol>
  <li><p>The same app compiled from the same source code a few days ago, which compiled with XCode 4.1 and iOS 4.3 SDK, everything works well. </p></li>
  <li><p>In addition, the app compiled with old version XCode and iOS SDK, can work on iOS5, after upgrade. </p></li>
  </ol>
  
  <p>However, the app which compiled with the same code, but XCode 4.2 and iOS5 SDK doesn't work.</p>
  
  <p>Do you have any ideas?
  Or is there any special work for iOS5?</p>
  
  <p>The sample code is like:</p>
  
  <pre><code>UIApplication *app = [UIApplication sharedApplication];
  NSArray *oldNotifications = [app scheduledLocalNotifications];
  
  // Clear out the old notification before scheduling a new one.
  if (0 &lt; [oldNotifications count]) {
  
      [app cancelAllLocalNotifications];
  } 
  
  // Create a new notification
  UILocalNotification *alarm = [[UILocalNotification alloc] init];
  if (alarm) {
  
      alarm.fireDate = theDate;
      alarm.timeZone = [NSTimeZone defaultTimeZone];
      alarm.repeatInterval = NSDayCalendarUnit; //repeat every day
      alarm.alertBody = [NSString stringWithFormat:@"alert"];     
      [app scheduleLocalNotification:alarm];
      [alarm release];
  }
  </code></pre>
  
  <p>Thanks,
  Michael</p>