- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
// last parameter is the setter code if value allowed to be set
#define SET_USING_CONFIG(cellSwitch,configKey,...)\
cell.cellSwitch = [(EExhibitorsListConfigItem*)[self.configInfo configItemAtIndex:0] configKey];\
if (cell.cellSwitch) {\
__VA_ARGS__;\
}
SET_USING_CONFIG(isLikesCountOn, showLikes,
cell.likesCount = exhibitor.Rating;
cell.likedByMe = exhibitor.IsRated; );
SET_USING_CONFIG(isInFavoritesOn, showFavoritesIndicator,
__weak EExhibitorCell *weakCell = cell;
cell.didChangeFavouritesStateBlock = ^(BOOL newFavState) {
[EExhibitorsListViewController updateFavoriteState:newFavState
ofExhibitor:exhibitor
inCell:weakCell];
};
);
Тут хуже... тут кусок тела передали параметром в макро... За такое надо зажимать не плоскогубцями, а в тиски, и на недельку.