Blocks as methods parameters #184

smic opened this Issue Feb 6, 2016 · 1 comment


None yet

3 participants

smic commented Feb 6, 2016

The compiler seems to have a problem with blocks as method parameters like in following code:

@implementation NSUndoManager (SMBlocks)

- (void)groupUndoWithActionName:(NSString *)name block:(void(^)())block {
    [self beginUndoGrouping];


    [self endUndoGrouping];
    [self setActionName:name];

@drkameleon drkameleon added the bug label Feb 6, 2016

Maybe this falls into the same category? From the Apple AstroLayout sample.

    UILayoutGuide *(^newLayoutGuide)(NSString *) = ^(NSString *identifierName){
        UILayoutGuide *newGuide = [[UILayoutGuide alloc] init];
        newGuide.identifier = identifierName;
        [self.view addLayoutGuide: newGuide];
        return newGuide;
    UILayoutGuide *leadingMercuryGuide = newLayoutGuide(@"leadingMercuryGuide");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment