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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -