2016-12-16 11 views
0

私は問題があります。私は警告を削除する方法を知りたがっていますか? おかげ あなたはNSGregorianCalendarが今NSGregorianCalendarは非推奨です

のiOS 8以降NSCalendarIdentifierGregorianに置き換えられていることがわかります(広い視野を作る)、エラーメッセージを読めば、 `

NSDate *fireDate = [picker_date date]; 

NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; 
NSDateComponents *offsetComponents = [[NSDateComponents alloc] init]; 
[offsetComponents setMinute:-10]; 
NSDate *heure_notification = [gregorian dateByAddingComponents:offsetComponents toDate:fireDate options:0]; 


UILocalNotification *local_rappel_notification = [[UILocalNotification alloc]init]; 
local_rappel_notification.fireDate = heure_notification; 
local_rappel_notification.alertBody = @"VOUS AVEZ UN VOL MAINTENANT DANS 10 MIN!!"; 
local_rappel_notification.timeZone = [NSTimeZone defaultTimeZone]; 
local_rappel_notification.soundName = UILocalNotificationDefaultSoundName; 
local_rappel_notification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1; 

[[UIApplication sharedApplication ]scheduleLocalNotification:local_rappel_notification]; 

}` warnig photo

+4

エラーの説明と説明をお読みください。 – rckoenes

答えて

8

だから使いますNSCalendarIdentifierGregorian