當我嘗試構建我的項目時,XCode中出現構建語義錯誤。我有3 NSOperation
類設置從互聯網下載信息,處理它,並將其發送到父視圖控制器,ViewController
的實例。下面是一個工人階級的代碼: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,只有一個正在工作。
ViewController.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
.m文件是否添加到您的目標? – 2013-03-04 16:39:57
顯示ViewController.h的內容 – 2013-03-04 16:48:33
您是否嘗試過Clean? – 2013-03-04 16:52:27