just learning iPhone and I’m getting the following error
[app scheduledLocalNotifications:notification];
no visible @interface for uiapplication declares the selector schedulelocalnotifications
can someone please help me out. I’m sure its something simple I am just not realizing as this is my first tutorial
thanks
-(IBAction)createNotification{
NSLog(@"createNotification");
NSString *dateString = dateTextField.text;
NSString *textString = textTextField.text;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM-dd-yyyy HH:mm"];
[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:-18000]];
NSDate *alertTime = [formatter dateFromString:dateString];
UIApplication* app = [UIApplication sharedApplication];
UILocalNotification *notification = [[UILocalNotification alloc] init];
if (notification) {
notification.fireDate = alertTime;
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.repeatInterval = 0;
notification.alertBody = textString;
[app scheduledLocalNotifications:notification];
[app presentLocalNotificationNow:notification];
}
}
scheduledLocalNotifications is property.
read a documentation: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html
change to alike below code.