nsdate - ios set UIDatePicker time ahead -


i grab current time

nsdate * = [[nsdate alloc] init]; nscalendar *cal = [nscalendar currentcalendar]; nsdatecomponents * comps = [cal components:nsyearcalendarunit|nsmonthcalendarunit|nsdaycalendarunit fromdate:now]; 

and can set datepicker values desire

nsdate * date = [cal datefromcomponents:comps]; [self.off setdate:date animated:true]; 

but how add a, say, 5 minutes "now"?

try

nsdate *date = [[nsdate date] datebyaddingtimeinterval:5*60]; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -