When we use addOperationWithBlock to put a block on the NSOperation queue, I thought the block couldn’t take any parameters, but it looks like we’re passing two parameters. What am I missing?


See Blocks Programming Topics: … TP40007502

See also: Programming with Objective-C: … locks.html


To be more specific, I’m referring to the following line on page 535:

[[NSOperationQueue mainQueue] addOperationWithBlock:^{block(cachedChannel, nil);}];

The documentation for addOperationWithBlock() says “The block should take no parameters and have no return value.”, but we are passing a block that takes two parameters, yes?