If you get userDate from user and nowDate = [NSDate date]then
NSComparisonResult diff = [userDate compare: nowDate];
If diff NSOrderedDescending, then userDate will be later than nowDate, and you will set the alarm for today. If it is NSOrderedAscending, then you will set an alarm for tomorrow. You can check NSOrderedSame, but it never will be.
You would not want to determine which day, so it seems to me that adding the NSTimeIntervaldifference is plus 24 * 60 * 60 (if the alarm is tomorrow) or just the difference (if it is the alarm today).
I do not know why everyone is trying to make alarms. This is impossible to do, as far as I can tell.
source
share