我有一个继承NSThread
的小组:
头:
@interface MyService : NSThread {
-(void)startMe;
}
实现:
@implementation MyService
-(void)startMe {
[self start];
}
@end
在另一个课程中,我得到了MySerivce
的实例:
MyService *service = [self getMyService];
[service startMe];
...
// here, what is the best practice to gracefully stop the service thread ?
如何在服务线程启动后优雅地停止服务线程?