0
剛開始學習iPhone,我收到以下錯誤爲「的UIApplication ..本地通知教程失敗沒有明顯的@interface
[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];
}
}
謝謝!!!欣賞幫助 – solarissf 2013-02-09 02:40:46
滿意如果,upvote。 V檢查請^^ – 2013-02-09 02:41:59
所以我使用模擬器...和通知只顯示一個橫幅...我怎樣才能改變它的警報? – solarissf 2013-02-09 03:18:20