When using @weakify, I get error unexpected '@' in the program. Am I missing some .h files? I already imported ReactiveCocoa.h. Is there any thing I should do ?
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
_isSeperateFill = YES;
_isBorderStroke = NO;
_isSeperatedStroke = YES;
_contentWidth = 0;
@weakify(self);
[RACObserve(self, dataVO) subscribeNext:^(TableDataVO* dataVO){
if( dataVO ){
NSString* indexKey = [[dataVO.tableDataDictionary allKeys] objectAtIndex:0];
_keys = [dataVO.tableDataDictionary allKeys];
@strongify(self);
_rows = [[self.dataVO.tableDataDictionary objectForKey:indexKey] count];
@strongify(self);
[self.styleVO setTableHeaderLineHorizontalMargin:self.styleVO.tableWidth / [_keys count]];
}
}];
@weakify(self);
[RACObserve(self, styleVO) subscribeNext:^(TableStyleVO* styleVO){
if( styleVO ){
styleVO.tableHeaderLineHorizontalMargin = styleVO.tableWidth / [_keys count] / 2;
}
}];
}
return self;
}
@weakify
, @strongify
and friends are part of libextobjc, not ReactiveCocoa proper.
Try adding this line (per @chakming's comment):
#import "ReactiveCocoa/RACEXTScope.h"
Or for pre-2.3.1 ReactiveCocoa (my original answer), use:
#import <ReactiveCocoa/EXTScope.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With