I have a class which inherits NSThread
:
header:
@interface MyService : NSThread {
-(void)startMe;
}
implementation:
@implementation MyService
-(void)startMe {
[self start];
}
@end
In another class, I get a instance of MySerivce
:
MyService *service = [self getMyService];
[service startMe];
...
// here, what is the best practice to gracefully stop the service thread ?
How can I gracefully stop service thread after it has been started?