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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -