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 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题