I am trying to understand NSOperationQueue's and am trying to create the most simple example possible. I have the following:
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");
}];
But would like to do this:
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];
Is this latter form possible? Can I convert a block to an NSOperation?
thx in advance