ReactiveObjC icon indicating copy to clipboard operation
ReactiveObjC copied to clipboard

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

Open CocoaJiang opened this issue 2 years ago • 2 comments

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

CocoaJiang avatar Oct 08 '23 09:10 CocoaJiang

Try to use my fork, https://github.com/sdkdimon/RACObjC

sdkdimon avatar Oct 31 '23 21:10 sdkdimon

Also it is separated for UI and Non UI modules.

sdkdimon avatar Oct 31 '23 21:10 sdkdimon