- 開發(fā)中經(jīng)常會遇到執(zhí)行Button的點擊事件,需要傳入一個參數(shù),而蘋果自帶的方法只能傳遞Button本身
所以我們可以通過別的方法來變相的傳遞參數(shù):
比如:自定義Button,給Button附加一個屬性:
@interface WLKButton : UIButton
@property (nonatomic, strong) id info;
@end
在初始化自定義Button的時候:
WLKButton *button = [WLKButton alloc] init];
button.info = 要傳的數(shù)據(jù)