Searching for a way to change the \"Close\" button text/functionality of a UILocalNotification...
I\'ve found that it\'s im
A UILocalNotification is just a storage for the notification's information. It does not perform anything.
Moreover your application does not display the notification. Another process does. So subclassing UILocalNotification is just useless.
EDIT at December 22nd, 17:53 UTC+1:
Yes, you can subclass UILocalNotification. But UILocalNotification is an abstract class and none of its properties is implemented. The alloc method is overridden so it returns an instance of UILocalNotification, a private subclass. That's why you cannot instantiate UILocalNotificationExampleSubclass.
But still, there is not point to subclass UILocalNotification because when you schedule a notification using -[UIApplication scheduleLocalNotification:] or present the notification immediately using -[UIApplication presentLocalNotification:], the operating system copies the notification.
That copy is stored in another process managed by the system, which uses its own private storage mechanism. A UILocalNotification is just a storage for a bunch of properties that is destined to get serialized and sent from the application to the operating system.
Now, we have that other process storing all the scheduled local notifications and waiting for a notification to fire. When that happens, that process will check if your application is in the foreground.
UILocalNotification class.UILocalNotification. Then, the UIApplication shared instance will access its delegate property and check if that delegate implements application:didReceiveLocalNotification:. If it does, you get the notification back and can do anything you want with that notification. For example, you may choose to display the notification using an alert view.Configuring and displaying the alert view can be done like this:
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
UIAlertView *alertView =
[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Alert", nil)
message:NSLocalizedString(notification.alertBody, nil)
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"OK", nil), nil];
[alertView show];
[alertView release]; // unless your project uses Automatic Reference Counting
}
I hope this longer response did answer your question, if what I'm saying is true.