Почему мой подкласс NSOperation запускает метод main в главном потоке?Я хочу, чтобы он работал асинхронно.
@interface ServiceClient : NSOperation
@end
@implementation ServiceClient
- (void)main
{
if ([[NSThread currentThread] isEqual:[NSThread mainThread]])
{
NSLog(@"Why does this get called on the main thread");
}
}
@end
Запуск операции
ServiceClient *serviceClient = [[ServiceClient aloc] init];
[serviceClient start];
РЕДАКТИРОВАТЬ:
Документация предлагает переопределить isCuncurrent и вернуть да,но метод не вызывается.
- (BOOL)isConcurrent
{
return YES;
}