nstimer - timer in iOS not working -
i have code repeated timer in app:
(inside viewdidappear)
nsdate *date = [nsdate datewithtimeintervalsincenow: 3]; nstimer *restrictiontimer = [[nstimer alloc] initwithfiredate: date interval: 3 target: self selector:@selector(changerestriction) userinfo:nil repeats:yes];
and
- (void) changerestriction { nslog(@"inside !!"); }
however, dont see output, ?
if you're using -initwithfiredate:..
have manually add timer nsrunloop. use +scheduledtimerwithtimeinterval:..
, automatically trigger.
Comments
Post a Comment