代理设计模式,和监听方法

2015-07-03  本文已影响177人  爱霉霉

代理的使用步骤

@property (nonatomic, weak) id<XMGWineCellDelegate> delegate;
xxx.delegate = yyy;
if ([self.delegate respondsToSelector:@selector(wineCellDidClickPlusButton:)]) {
    [self.delegate wineCellDidClickPlusButton:self];
}

iOS监听某些事件的方法

block取代代理

上一篇 下一篇

猜你喜欢

热点阅读