未读取的类...未知的类型名称

时间:2012-06-22 20:23:24

标签: objective-c ios xcode class

我不确定发生了什么或者我改变了什么,但突然之间我正在尝试引用“那是在项目树中”和文件夹中(当我“在finder中显示”时)根本没有阅读......我在同一行代码中遇到了多个错误[见附件]。

enter image description here

请帮助!!!


当我尝试将HomeViewController.h导入我的MainContainerViewController

时,会出现此问题

使用:

#import <UIKit/UIKit.h>
#import "ViewController.h"

@interface MainContainerViewController : UIViewController {

ViewController *parent;

NSString *FACING;
IBOutlet UIView *container;

IBOutlet UIView *topNav;

IBOutlet UIButton *homeBTN;
IBOutlet UIImageView *homeImg;
IBOutlet UILabel *homeLabel;
IBOutlet UIImageView *seperator1;
IBOutlet UIButton *bookmarksBTN;
IBOutlet UIImageView *bookmarksImg;
IBOutlet UILabel *bookmarksLabel;
IBOutlet UIImageView *seperator2;
IBOutlet UIButton *favouritesBTN;
IBOutlet UIImageView *favouritesImg;
IBOutlet UILabel *favouritesLabel;
IBOutlet UIImageView *seperator3;
IBOutlet UIButton *notesBTN;
IBOutlet UIImageView *notesImg;
IBOutlet UILabel *notesLabel;
IBOutlet UIImageView *seperator4;
IBOutlet UIButton *fontBTN;
IBOutlet UIImageView *fontImg;
IBOutlet UILabel *fontLabel;
IBOutlet UIImageView *seperator5;
IBOutlet UIButton *settingsBTN;
IBOutlet UIImageView *settingsImg;
IBOutlet UILabel *settingsLabel;

NSString *drawerIsAnimating;

//SETTINGS (LOCAL)
NSString *fontSize;

断裂:

#import <UIKit/UIKit.h>
#import "ViewController.h"
#import "HomeViewController.h"

@interface MainContainerViewController : UIViewController {

ViewController *parent;

NSString *FACING;
IBOutlet UIView *container;

IBOutlet UIView *topNav;

IBOutlet UIButton *homeBTN;
IBOutlet UIImageView *homeImg;
IBOutlet UILabel *homeLabel;
IBOutlet UIImageView *seperator1;
IBOutlet UIButton *bookmarksBTN;
IBOutlet UIImageView *bookmarksImg;
IBOutlet UILabel *bookmarksLabel;
IBOutlet UIImageView *seperator2;
IBOutlet UIButton *favouritesBTN;
IBOutlet UIImageView *favouritesImg;
IBOutlet UILabel *favouritesLabel;
IBOutlet UIImageView *seperator3;
IBOutlet UIButton *notesBTN;
IBOutlet UIImageView *notesImg;
IBOutlet UILabel *notesLabel;
IBOutlet UIImageView *seperator4;
IBOutlet UIButton *fontBTN;
IBOutlet UIImageView *fontImg;
IBOutlet UILabel *fontLabel;
IBOutlet UIImageView *seperator5;
IBOutlet UIButton *settingsBTN;
IBOutlet UIImageView *settingsImg;
IBOutlet UILabel *settingsLabel;

NSString *drawerIsAnimating;

//SETTINGS (LOCAL)
NSString *fontSize;

4 个答案:

答案 0 :(得分:8)

您可能有一个标题导入周期。

添加

@class MainContainerViewController2;

之前

@interface HomeViewController2

它应该解决这个特定问题。

根据经验,如果你没有绝对需要,你不应该在标题中#import标题,即。一个超类标题。如果需要使用类,请使用@class声明它,而不是导入类头。这样做,99%的时间你都应该安全。

答案 1 :(得分:0)

该文件可能未包含在您正在构建的目标中。

答案 2 :(得分:0)

尝试检查MainContainerViewController2目标。

单击MainContainerViewController2 .m和.xib并选中Utilities面板(View&gt; Utilities&gt; Show File Inspector),如果勾选目标成员资格部分。

答案 3 :(得分:0)

首先非常小心地检查你的MainContainerViewController2.h文件,看看文件中是否有任何转发字符。

相关问题