I m trying to set alarm from app with my audio file but getting lots of messages like
Use of undeclared identifier EKAlarm
Unknown receiver EKEvent did you mean UIEvent
Member reference base type 'int" is not a structure or union
@property (retain, nonatomic) EKAlarm *alarm;
@synthesize alarm;
-(void) AlarmAction:(id)sender{
EKAlarm *alarm = [EKAlarm alarmWithRelativeOffset:-300];
[EKEvent addAlarm:alarm];
alarm.soundName =
}
Thanks for help.
Have you added the EventKit framework? It must be added under Link Binary With Libraries
under the Build Phases
tab of your project properties.
====== EDIT:
You should be using UILocalNotification ( Class Reference ). You should:
fireDate
property to the time you would like the alarm to fire, repeatInterval
to some NSCalendarUnit (see here ), soundName
property to the file name of the audio file you wish to play, [[UIApplication sharedApplication] scheduleLocalNotification: myNotification];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.