How to create block for addObserverForName:object:queue:usin


#1

I have no idea because the books only show ways to create block with one parameters group together while this new method has many separate parameters.


#2

One example might look like this:

NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];

[nc addObserverForName:SomeNotificationName
    object:nil
    queue:nil
    usingBlock:^(NSNotification *note) {
        NSLog(@"Something happened and posted notification: %@",note);
    }];