addOperationWithBlock


#1

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?


#2

See Blocks Programming Topics: developer.apple.com/library/ios … TP40007502

See also: Programming with Objective-C: developer.apple.com/library/ios … locks.html


#3

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?