title: How to delete all local notifications when an application is deleted from an iPhone
body: <p>Let's say I set 5 local notification for an iPhone application, then the user deletes the app. If the app is installed again, it shows the previous notifications.</p>
  
  <p>I know the following code deletes all notifications</p>
  
  <pre><code>[[UIApplication sharedApplication] cancelAllLocalNotifications];
  </code></pre>
  
  <p>But where do I put that code so that it executes when the application is deleted?</p>
  
  <p>Or any other way to solve this problem.</p>