ReactiveCocoa / ReactiveObjC

The 2.x ReactiveCocoa Objective-C API: Streams of values over time
MIT License
2.6k stars 496 forks source link

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

Open CocoaJiang opened 1 year ago

CocoaJiang commented 1 year ago

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);
"
sdkdimon commented 1 year ago

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

sdkdimon commented 1 year ago

Also it is separated for UI and Non UI modules.