objective c - NSTimer called method causes thread break point -


running class below gives thread break @ end of first run of @selector method timerevent called nstimer object [ timer ]. error given __nsfctimer, '< error: unknown class>'. seems crash after first iteration of currentnumber 1.

any ideas?

    //     //  numberlooper.m     //  delegation excersise     //     //  created edwin on 7/31/13.     //  copyright (c) 2013 offbeat software. rights reserved.     //      #import "numberlooper.h"      @implementation numberlooper      -(void) timerevent: (nstimer *)timer {         if (currentnumber < 256)             currentnumber ++;         else             currentnumber = 0;          nslog (@"%d", currentnumber);         [self.delegate numberhaschangedto:currentnumber];     }      -(void) starttimerloop {         if (!timer) {             timer = [nstimer scheduledtimerwithtimeinterval: 0.020 target:self                 selector:@selector(timerevent:) userinfo:nil repeats:yes];                      nslog(@"the timer has started");              }              else              {             nslog(@"the timer running");          }     }       @end 


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -