0
有两种类A和B:理解协议实现与例如UIAlertViewDelegate
@interface答:NSObject的< UIAlertViewDelegate> {...} @end
@interface B {...}
A将通过创建B来使用B并使用它。
在B中,有机会创建UIAlertViewDialog,并进行一些用户交互。
我认为在类A中实现clickedButtonAtIndex是合理的,因为A被声明为确认UIAlertViewDelegate。但是,真正的是,我们应该在B.实现
- (无效)alertView:(UIAlertView中*)警报clickedButtonAtIndex:(NSInteger的)buttonIndex {//喇嘛喇嘛}
我真的不明白什么是真正的原因来确认这种情况下的协议。
在此先感谢。
感谢您的回答,这清除了我的困惑。 – Forrest 2010-06-29 05:51:50
如果您可以接受答案(通过点击勾号),如果这是您正在查找的信息,那将会很棒;) – Shingoo 2010-06-29 15:48:46