입니다. NSOperationQueue를 이해하려고하는데 가능한 가장 간단한 예제를 만들려고합니다.거기에 NSOperationQueue에 블록을 추가하는 방법은
NSOperationQueue *myOQ=[[NSOperationQueue alloc] init];
[myOQ addOperationWithBlock:^(void){
NSLog(@"here is something for jt 2");
}];
[myOQ addOperationWithBlock:^(void){
NSLog(@"oh is this going to work 2");
}];
그러나이 작업을 수행하고 싶습니다 :
void (^jt)() = ^void(){
NSLog(@"here is something for jt");
};
void (^cl)() = ^void(){
NSLog(@"oh is this going to work");
};
NSOperationQueue *myOQ=[[NSOperationQueue alloc] init];
[myOQ addOperation:jt];
[myOQ addOperation:cl];
이 후자의 형태가 가능 나는 다음 있나요? 블록을 NSOperation으로 변환 할 수 있습니까? 당신은 할 수
없음을 할 수 있지만, 왜 당신도 그렇게 할 수 있습니까? 무엇을 성취하려고합니까? –
간단한 예제로 배우기 :이 또한 도움이되었지만 의견도 읽으십시오. http://eng.pulse.me/concurrent-downloads-using-nsoperationqueues/ – timpone