Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks as methods parameters #184

Open
smic opened this issue Feb 6, 2016 · 2 comments
Open

Blocks as methods parameters #184

smic opened this issue Feb 6, 2016 · 2 comments
Labels

Comments

@smic
Copy link

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];

    block(self);

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

@end
@drkameleon drkameleon added the bug label Feb 6, 2016
@kennebecstars
Copy link

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");

@JanX2
Copy link

JanX2 commented Mar 14, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants