-1
// the action cannot be NULL. Note that the target is not retained.
- (void)addTarget:(nullable id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;
注意,目標不保留。
而UIControl + BlocksKit.m
BKControlWrapper *target = [[BKControlWrapper alloc] initWithHandler:handler forControlEvents:controlEvents];
[handlers addObject:target];
[self addTarget:target action:@selector(invoke:) forControlEvents:controlEvents];
所以UIControl
如何管理目標,爲什麼選擇Target沒有公佈?
UIControl目標未被釋放,因爲它未被保留。 – rmaddy