Chr*_*son 4 xcode class objective-c ios
我不确定发生了什么或者我改变了什么,但突然之间我试图引用"那是在项目树中"和文件夹中(当我"在finder中显示"时)不是正在阅读......我在同一行代码中遇到了多个错误[见附件].

请帮忙!!!
当我尝试将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;
Run Code Online (Sandbox Code Playgroud)
等等
破碎:
#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;
Run Code Online (Sandbox Code Playgroud)
等等
您可能有一个标题导入周期.
加
@class MainContainerViewController2;
Run Code Online (Sandbox Code Playgroud)
就在此之前
@interface HomeViewController2
Run Code Online (Sandbox Code Playgroud)
它应该解决这个特定的问题.
根据经验,如果你没有绝对需要,你不应该在标题中#import标题,即.一个超类标题.如果需要使用类,请使用@class声明它,而不是导入类头.这样做,99%的时间你应该安全.
| 归档时间: |
|
| 查看次数: |
4758 次 |
| 最近记录: |