gpt4 book ai didi

iphone - 实例化其他 View Controller 时出错

转载 作者:行者123 更新时间:2023-12-03 20:25:51 24 4
gpt4 key购买 nike

我确信这真的很愚蠢,但我似乎无法理解为什么会出现此错误。在我的项目中,我有一个 View Controller 和另一个执行一些数据结构化工作的类(无论如何都不相关)。当尝试在我的类中实例化它时,我收到编译错误:“未知类型名称“ View Controller ””。

这是我的类(class).h:

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import "MyLocationController.h"
#import "GetZip.h"
#import "SecondTab.h"

@interface DataEngine : NSObject <MyLocationControllerDelegate, MKMapViewDelegate, GetZipcodeDelegate> {

MyLocationController *CLController;
GetZip *getzip;
SecondTab *secondTab; //ERROR IS HERE

}

我的 View Controller .h:

#import <UIKit/UIKit.h>
#import "FirstTab.h"
#import "DataEngine.h"

@interface SecondTab : UIViewController <UITableViewDelegate, UITableViewDataSource> {

IBOutlet UITableView *table1;
NSString *address;
NSDate *time;
NSDictionary *dataDict;
DataEngine *fullData;

}

(我省略了所有@synthesis,因为我认为它们并不重要......无论如何,我对所有内容都使用@property(非原子,保留))。

知道这里会出什么问题吗?

最佳答案

你为什么不尝试转发声明它。使用@class secondaryTab 而不是#import secondaryTab?如果这就是问题所在,它将有助于避免任何循环夹杂物。

关于iphone - 实例化其他 View Controller 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7068230/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com