刚刚学习 iPhone,我收到以下错误
[app scheduledLocalNotifications:notification];
uiapplication 没有可见的@interface 声明选择器 schedulelocalnotifications
有人可以帮帮我吗?我确定它很简单,我只是没有意识到,因为这是我的第一个教程
谢谢
-(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];
}
}