iOS set local notification on a specific day

前端 未结 4 1215
终归单人心
终归单人心 2021-01-21 02:17

I am sure this question is duplicated somewhere, but I can\'t find a solution. I am making an app in which one feature allows the user to select the days and times they will rec

4条回答
  •  后悔当初
    2021-01-21 03:11

    Exactly the same way you are doing right now, but create a date differently:

    NSDateComponents *comps = [[[NSDateComponents alloc] init] autorelease];
    [comps setDay:1];
    [comps setMonth:1];
    [comps setYear:2013];
    [comps setHour:10];
    [comps setMinute:10];
    [comps setSecond:10];
    localNotif.fireDate = [[NSCalendar currentCalendar] dateFromComponents:comps];
    

提交回复
热议问题