IOS efficient processing-Macro definition cell creation that defines a replaceable class and parameter and replaces it with its method

< H1 > define cellWithClassIdentifier (Class,identifier)\ < / H1 >

+ (instancetype) cellWithTableView: (UITableView ) tableView identifier: (NSString ) identifier {\
Class * cell = [tableView dequeueReusableCellWithIdentifier:identifier];\
if (! cell) cell = [[Class alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];\
cell.selectionStyle = UITableViewCellSelectionStyleNone;\
cell.separatorInset = UIEdgeInsetsMake (0,0,0,0);\
return cell;\
}\

the difficulty is how to handle the incoming class

May.22,2021

this problem has been resolved through classification

Menu