I have these declarations in the header file:
Note: I will not explain all the code, I think it is easy to understand
typedef void (^loopCell)(id cell); -(id)allCells:(loopCell)cell;
And the implementation of allCells :
-(id)allCells:(loopCell)cell { for (AAFormSection *section in listSections) { for (id _cell in section.fields) { cell(_cell); } } return nil; }
Using the allCells function:
-(void)setFieldValue:(NSString *)value withID:(int)rowID { [self allCells:^(id cell) { if([cell isKindOfClass:[AAFormField class]]) { AAFormField *_cell = (AAFormField *)cell; if(_cell.rowID == rowID) { _cell.value = value;
My problem is , I cannot complete the allCells loop in the middle (in fact, when I found the object that I need in the loop, I don't want to go through other objects)
How can I stop the allCells cycle in the middle?
source share