nsdatepicker

How to get audio to play at time from NSDatePicker?

放肆的年华 提交于 2019-12-04 07:37:07
问题 I'm making an app which requires a sound to play at a time in the future set by the user using NSDatePicker how would I do so? I already have the AVAudioPlayer setup, I just need the help with the playing itself. And please write how to do so that answers the entire question instead of leading me elsewhere. The aim is to get an alarm that can be set by the user at a specific time using NSDatePicker and using a sound I have made and added to the project. And then for the user to have to turn

Minimum and maximum date in UIDatePicker

笑着哭i 提交于 2019-11-27 03:38:12
I want to get the minimum and maximum date from a date picker, but minimum date should be "- 18" of the current date and the maximum date should be "- 100" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918. What I have done so far is : NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; NSInteger year = [components year]; int mindt = year - 18; int maxdt = year -100; // NSDate * MinDate = [components year] - 18

Minimum and maximum date in UIDatePicker

纵然是瞬间 提交于 2019-11-26 12:39:24
问题 I want to get the minimum and maximum date from a date picker, but minimum date should be \"- 18\" of the current date and the maximum date should be \"- 100\" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918. What I have done so far is : NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; NSInteger year =