title: How do I create and cancel unique UILocalNotification from a custom class?
body: <p>Currently I have a timer with an alarm (local notification).</p>
  
  <p>I want to create a timer class from this code to create multiple timers and notifications (at most 5) and I am struggling with how to create and cancel unique notifications with a class method. </p>
  
  <pre><code>- (UILocalNotification *) startAlarm {
  
      [self cancelAlarm]; //clear any previous alarms
  
      alarm = [[UILocalNotification alloc] init];
      alarm.alertBody = @"alert msg"
      alarm.fireDate = [NSDate dateWithTimeInterval: alarmDuration sinceDate: startTime]; 
      alarm.soundName = UILocalNotificationDefaultSoundName; 
  
      [[UIApplication sharedApplication] scheduleLocalNotification:alarm];
  
  }
  </code></pre>
  
  <p>My assumption is that if I have a class method that creates a UILocalNotification called "alarm" iOS will see all of the notifications as being the same notification and the following method will not function the way I want it to:</p>
  
  <pre><code>- (void)cancelAlarm {
  
      if (alarm) {    
          [[UIApplication sharedApplication] cancelLocalNotification:alarm];
      }
  
  }
  </code></pre>
  
  <p>So I need a way to name these UILocalNotifications as they are created e.g. alarm1 alarm2...alarm5 so I can cancel the right one.</p>
  
  <p>Thanks in advance.</p>