iosでUIControlコントロールターTarget-Actionを削除する方法
コード:
Category 声明:
@interface UIControl (Additions)
– (void)removeAllTargets;
@end
Category 実現:
@implementation UIControl (Additions)
– (void)removeAllTargets {
for (id target in [self allTargets]) {
[self removeTarget:target action:NULL forControlEvents:UIControlEventAllEvents];
}
}
@end