liuxingshanguo 2014-08-09 12:40
浏览 1771

通过代码给xib加控件,控件是加上去,点击却报错

// 4.创建按钮
BFModuleItem *button = [BFModuleItem buttonWithType:UIButtonTypeCustom];
// 4.1.设置item的frame
CGFloat y = (kCenterCellHeight + kCellVerticalMargin) * index;
button.frame = CGRectMake(kIconWidth, y, kCenterCellWidth - kIconWidth, kIconHeight);
[button addTarget:self action:@selector(rightButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[button setBackgroundColor:[UIColor greenColor]];
[_scrollView addSubview:button];

  • (void)rightButtonClick:(BFModuleItem *)item { BFLog(@"bbbbbbb"); }

上面的代码都有写却报这个错误,为什么会去UIViewControllerWrapperView里面找方法,是不是xib连线有问题,可是按钮却有显示出来,哪位大神知道的,麻烦说下,谢谢
-[UIViewControllerWrapperView rightButtonClick:]: unrecognized selector sent to instance 0x8d4b450

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器