Not quite related to the question, but I thought I would comment and mention that your use and placement of weak and strong characters is incorrect. The correct version will be ...
- (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){ @strongify(self); if( dataVO ){ NSString* indexKey = [[dataVO.tableDataDictionary allKeys] objectAtIndex:0]; _keys = [dataVO.tableDataDictionary allKeys]; _rows = [[self.dataVO.tableDataDictionary objectForKey:indexKey] count]; [self.styleVO setTableHeaderLineHorizontalMargin:self.styleVO.tableWidth / [_keys count]]; } }]; [RACObserve(self, styleVO) subscribeNext:^(TableStyleVO* styleVO){ if( styleVO ){ styleVO.tableHeaderLineHorizontalMargin = styleVO.tableWidth / [_keys count] / 2; } }]; } return self; }
As you can see above, you only need to use weakness once. Once defined, it is defined for the entire area.
Similarly, syntax is needed only once in a block. In addition, he needed the top of the block so that you canceled the weak link as a strong link as soon as possible.
By the time it was used in your example, it is possible that the captured weak reference to the "I" could go out of scope.
source share