我不确定这里的术语,但是:
我在 iPhone 应用程序中有一个 ViewController,它需要成为其他两个对象(委托(delegate)者)的委托(delegate)。
这可能吗?这不起作用:
@interface my_projectViewController : UIViewController <DelegatorOne> <DelegatorTwo> {
...
}
最佳答案
正确的复数形式是 delegates 是的,绝对可以让您的类成为不同协议(protocol)的委托(delegate)。
语法是这样的:
@interface my_projectViewController : UIViewController <DelegatorOne, DelegatorTwo> {
...
}
我有一个看起来像这样的:
@interface MyViewController : UIViewController<UITextFieldDelegate,UIWebViewDelegate,UINavigationBarDelegate,UIActionSheetDelegate,URLDownloaderDelegate> {
}
最好的问候,
关于iphone - 一个对象可以作为多个委托(delegate)人的委托(delegate)吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1264561/