edi*_*die 21 xcode objective-c
我正在构建我的应用程序时,我今天经历了一些事情.我在MyObject1中声明了一个协议,并在其上添加了委托属性.我已将MyObject2指定为MyObject1的委托.我像往常一样以这种方式添加它
@interface MyObject2 : UIViewController <DelegateOfObject1>
但Xcode表示无法找到我的协议声明.我检查了我的代码,但我已经宣布了这个协议.我尝试将MyObject2指定为其他Object的委托.我像这样编辑我的代码
@interface MyObject2 : UIViewController <UITableViewDelegate,DelegateOfObject1>
但Xcode再次说它无法找到DelegateOfObject1的协议声明.我试图删除我的代码上的DelegateOfObject1并添加指定MyObject作为其他对象的委托,它就像这样.
@interface MyObject2 : UIViewController <UITableViewDelegate,UITabBarDelegate>
没有发现任何错误.然后我再次尝试在代码中再次添加DelegateOfObject1
@interface MyObject2 : UIViewController <UITableViewDelegate,UITabBarDelegate,DelegateOfObject1>
那时Xcode没有在我的代码上发现任何错误.所以我再次尝试在我的代码上删除UITableViewDelegate和UITabBarDelegate.
@interface MyObject2 : UIViewController <DelegateOfObject1>
那时没有发现错误,但那是我之前写过的相同代码.在我的代码中,这些东西应该是什么原因?
谢谢...
归档时间: |
|
查看次数: |
25574 次 |
最近记录: |