Closed jokerxsun closed 7 years ago
HyPopMenuView.m 文件内,- (void)selectedFunc:(PopMenuButton *)sender 方法有问题
NSLog(@"点击按钮的标题>>>>>>>>>>>>>>>>>>>>>>>>%@", sender.model.titleString);
// sender.layer.cornerRadius = CGRectGetWidth(sender.frame)/2; // sender.backgroundColor = [UIColor redColor]; //UIWindow window = (id)[self getMainView]; __weak HyPopMenuView weakView = self; for (PopMenuModel obj in _dataSource) { PopMenuModel model = obj; NSLog(@"遍历到的按钮>>>>>>>>>>>>%@", obj.titleString); PopMenuButton button = (id)model.customView; if (sender == button) { [sender selectdAnimation]; }else{ [button cancelAnimation]; } dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [model performSelector:@selector(_obj)]; }); } 其中的判断方式,sender == button, 并不安全 sender 地址出现重复,放大效果有问题。
HyPopMenuView.m 文件内,- (void)selectedFunc:(PopMenuButton *)sender 方法有问题
// sender.layer.cornerRadius = CGRectGetWidth(sender.frame)/2; // sender.backgroundColor = [UIColor redColor]; //UIWindow window = (id)[self getMainView]; __weak HyPopMenuView weakView = self; for (PopMenuModel obj in _dataSource) { PopMenuModel model = obj; NSLog(@"遍历到的按钮>>>>>>>>>>>>%@", obj.titleString); PopMenuButton button = (id)model.customView; if (sender == button) { [sender selectdAnimation]; }else{ [button cancelAnimation]; } dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [model performSelector:@selector(_obj)]; }); } 其中的判断方式,sender == button, 并不安全 sender 地址出现重复,放大效果有问题。