ios遇到的问题

140 阅读1分钟
  • could not execute support to read Objective-C lass data in the process.This may reduce the qulity avaliable.

    懒加载,重写set方法,不能使用self,否则会报上面的错

  • 自定义UITableViewCell,向其中添加button,button的点击事件无法响应

    stackoverflow

    I faced a similar issue. I was programmatically adding an UIButton to the UITableViewCell via addSubview. The button would not respond to touch events. Using Debug View Hierarchy, I finally discovered that any subviews added to the UITableViewCell was behind contentView, which was blocking user input from reaching the UIButton. The issue was resolved by adding the UIButton to contentView instead of the UITableViewCell.

    这是因为向cell addSubview:button button会被cell自带的contentView挡住,应该向cententView添加subview