当我尝试构建我的项目时,我在 XCode 中遇到构建语义错误。我NSOperation
设置了 3 个类来从 Internet 下载信息,对其进行处理,并将其发送到父视图控制器,即ViewController
. 这是工人阶级的代码:
#import <Foundation/Foundation.h>
#import "ViewController.h"
@interface ImageGetter : NSOperation
@property (nonatomic) int sid;
@property (nonatomic, retain) ViewController* pvc;
@end
这是不工作的代码:
#import <Foundation/Foundation.h>
#import "ViewController.h"
@interface CurrentGetter : NSOperation
@property (nonatomic) int sid;
@property (nonatomic, retain) ViewController* pvc;
@end
错误:
ERROR: Unknown type name 'ViewController'; did you mean 'UIViewController'?
为什么我会收到此错误?我在两个文件中都导入了 ViewController.h,只有一个在工作。
视图控制器.h:
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import "DataGetter.h"
#import "CurrentGetter.h"
#import "AppDelegate.h"
@interface ViewController : UIViewController <UITabBarDelegate>
{
NSTimer* tmr;
}
@property (nonatomic) float max;
@property (nonatomic, retain) NSDictionary* plist;
@property (nonatomic, retain) NSArray* processingobj;
@property (nonatomic, retain) AVAudioPlayer* intro;
@property (nonatomic, retain) AVAudioPlayer* woop;
@property (nonatomic) float dataDone;
@property (nonatomic) BOOL introDone;
@property (nonatomic) BOOL currentDone;
@property (nonatomic) int newSid;
@property (nonatomic) int newPart;
@property (nonatomic, retain) NSMutableArray* views;
@property (nonatomic) int audioTab;
@property (nonatomic) int currentSid;
@property (nonatomic) BOOL isPlaying;
@property (nonatomic, retain) UIScrollView* partTab;
@property (nonatomic, retain) NSMutableArray* nowPlayingObj;
@property (nonatomic, retain) UINavigationBar* audioNav;
@property (nonatomic, retain) MPMoviePlayerController* player;
@property (nonatomic, retain) UILabel* elapsed;
@property (nonatomic, retain) UILabel* remaining;
@property (nonatomic, retain) UISlider* slider;
@property (nonatomic) BOOL sliderEditing;
@property (nonatomic, retain) UIButton* playBtn;
@property (nonatomic, retain) UITabBar* tabBar;
//Images
@property (nonatomic, retain) UIImage* announcement;
@property (nonatomic, retain) NSMutableArray* seriesBanners;
@property (nonatomic, retain) UIProgressView* prog;
- (void)plistDone;
@end