问题描述
|
我的应用程序有两个类:
exampleAppDelegate
和exampleController
。
我将exampleController.h
导入exampleAppDelegate.m
,并将exampleAppDelegate.h
导入exampleController.m
。
当我尝试在exampleAppDelegate
类中使用exampleController
类的插座或动作时,编译器返回以下错误:
使用未声明的标识符,未找到操作。
当我尝试使用exampleController
中的exampleAppDelegate
中的变量时,也会发生相同的问题。
我究竟做错了什么?
解决方法
如果要对多个文件使用相同的方法/选择器来处理事件(如UIControlEventTouchDown ...),请尝试使用
addTarget:action:forControlEvents:
方法添加它们,而不是通过IBAction(接口生成器)进行添加。
另外,我认为您在控制器中导入委托的方法不正确。