代理設計模式

#pragma mark cell
@protocol QHMoneyBossClikedDelegate<NSObject>
-(void)ClikedByString:(NSString*)isContent and:(UITableViewCell*)cell;
@end


@property(assign, nonatomic)id<QHMoneyBossClikedDelegate>delegate;

點擊事件中
if ([self.delegate respondsToSelector:@selector(ClikedByString:and:)]) {
   [self.delegate ClikedByString:@"contact" and:self];
}

在控制器中
.delegate = self;
再實現協議中相關的方法
相關文章
相關標籤/搜索