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 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
    • ¥30 求一段fortran代码用IVF编译运行的结果
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥30 python代码,帮调试,帮帮忙吧