Skip to content

Xcode 15 Release build error "error: unexpected '@' in program @weakify(self); ^" #196

Description

@CocoaJiang

my code

#import <ReactiveObjC/ReactiveObjC.h>
-(UIView * _Nonnull (^)(void (^ _Nonnull)(void)))addTouchAction{
    @weakify(self);
    return ^(void(^actionBlock)(void)){
        @strongify(self);
        self.userInteractionEnabled = YES;
        UITapGestureRecognizer *zer = [[UITapGestureRecognizer alloc]initWithActionBlock:^(id  _Nonnull sender) {
            actionBlock();
        }];
        [self addGestureRecognizer:zer];
        return self;
    };
}
build error : "error: unexpected '@' in program
    @weakify(self);
    ^
" , "error: unexpected '@' in program
        @strongify(self);
"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions