x_button = x_space + line * (x_space + buttonWidth);
y_button = y_space + row * (y_margin + buttonHeight);
NSString *title = dicArray[i][@"title"];
NSString *imageStr = dicArray[i][@"image"];
SEL selector = NSSelectorFromString(selectorArray[i]); // 反射机制,只要添加方法名的字符串,就能获得方法
HHSetButton *button = [HHSetButton buttonWithType:UIButtonTypeCustom];
[button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside];
时间: 2024-12-20 04:05:53