Even if there are some official APIs to do this, I strongly suggest you to NOT use them, cause they're leaked. You can use FXNotifications from Nick Lockwood, which provides the feature you want: use a block as notification listener.
Add the .h
& .m
files inside your project and then call:
[[NSNotificationCenter defaultCenter] addObserver:self
forName:@"ready"
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note, id observer) {
// Your inline function here
}];