Friday, 15 February 2013

No visible @interface for 'NSThread' declares the selector 'start' -



No visible @interface for 'NSThread' declares the selector 'start' -

ok, have been @ 2 hours now.

i can next lines of code run in simulator, cannot compile on device , dont know why.

i maintain getting compile error 'no visible @interface 'nsthread' declares selector 'start'. error occurs on line [t start];

here code:

@interface fmthread : nsobject { @private nscondition *waitcondition; } @property (copy) void (^block)(void); + (void)runinseparatethread:(void (^)(void))block; @end @implementation fmthread + (void)runinseparatethread:(void (^)(void))block { fmthread *thread = [[fmthread alloc] init]; thread.block = block; thread->waitcondition = [[nscondition alloc] init]; [thread->waitcondition lock]; nsthread *t = [[nsthread alloc]initwithtarget:thread selector:@selector(threadmain) object:nil]; [t start]; [thread->waitcondition wait]; [thread->waitcondition unlock]; } - (void)threadmain { @autoreleasepool { self.block(); [waitcondition broadcast]; } } @end

any help much appreciated. think sitting close trees see forrest here.

interface nsthread visible

No comments:

Post a Comment