您的位置:首页 > 移动开发 > IOS开发

iOS 23-自定义cell上的button点击事件.

2015-12-21 10:07 344 查看
1.在cell里,.h写一个Block.

@property (nonatomic,copy)void(^telephoneBlock)();
2. 在cell里,.m写一个点点击事件.

- (IBAction)didclickPhone:(id)sender {

if (self.telephoneBlock) {
self.telephoneBlock();
}
}

3.在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

cell.telephoneBlock=^(){

NSLog(@"phonenumber is ======%@",shopmodel.phone);
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: