这应该是一个简单的问题 - 但我很难搞清楚。我试图在一个对象上创建一个属性,这样在prepareForSegue期间,我可以告诉对象它的委托是什么。我知道我可以通过协议来做到这一点,但我认为这种情况下直接的做法是最简单的。不幸的是,下面的代码会导致一个编译器错误:声明委托属性时出错
#import <UIKit/UIKit.h>
#import "PlanningViewController.h"
@interface DepartmentViewController : UITableViewController
@property (nonatomic, weak) PlanningViewController *planningDelegate;
@end
当我键入财产申报时,Xcode识别PlanningViewController甚至显示文本,我只是通过TAB。但编译器却抱怨道:
Unknown type name 'PlanningViewController': did you mean 'UISplitViewController'?
我在做什么错?
PlanningViewController.h看起来是这样的:
#import <UIKit/UIKit.h>
#import "DepartmentViewController.h"
@interface PlanningViewController : UITableViewController
// Table cell connections
- (IBAction)addItemPressed:(id)sender;
@end
请显示'PlanningViewController.h'的内容。 – trojanfoe 2012-03-19 13:39:42