1
我有一個名爲friend的對象(我知道,第一個字母應該是大寫)。我在許多其他類和視圖控制器中使用這個類。Xcode不再識別對象
突然間,沒有改變任何代碼,我擁有的每個自定義對象,都停止認出對方。我總是得到錯誤未知類型名稱「朋友」。
我已經嘗試清除項目並重新啓動mac。 這個Xcode的WTF是錯誤的?突然之間,我的整個項目都停止了。
這裏是我的類currentUser.h
#import <Foundation/Foundation.h>
#import "friend.h"
@interface currentUser : NSObject<NSCoding>
{
BOOL fromfacebook;
@private
NSMutableArray *upLoadStack;
}
@property (nonatomic,strong)NSString *token;
@property (nonatomic,strong)NSString *email;
@property (nonatomic,strong)NSString *name;
@property (nonatomic,strong)UIImage *userImg;
@property (nonatomic,strong)NSString *username;
@property (nonatomic,strong)NSString *facebookID;
@property (nonatomic,strong)NSString *userPSW;
@property (nonatomic,strong)NSString *userID;
@property (nonatomic,strong)NSMutableArray *friendsList;
@property (nonatomic,strong)NSMutableArray *groups;
@property (nonatomic,strong)NSData *audioMessage;
@property (nonatomic,strong)NSMutableArray *mimosToDownload;
@property (nonatomic,strong)NSMutableArray *mimosDownloaded;
@property (nonatomic,strong)friend *friendToSend; //Here is where a I get the error of unknown type name
@end
這是friend.h
#import <Foundation/Foundation.h>
#import "currentUser.h"
#import "Imager.h"
@interface friend : NSObject<NSCoding>
@property (nonatomic,strong)NSString *username;
@property (nonatomic,strong)NSString *userID;
@property (nonatomic,strong)UIImage *userImg;
@property(nonatomic,strong)NSMutableData *buffer;
@property(nonatomic)BOOL flagDownloaded;
-(UIImage*)downloadImageBlocked;
-(id)init;
-(UIImage*)getFriendImg;
-(UIImage*)userImg;
-(NSString*)getUserID;
-(NSString*)getUserName;
- (void)encodeWithCoder:(NSCoder *)encoder;
-(bool)isNil;
@end
它工作!謝謝,問題是這是一箇舊項目,當我開始在Objective-C中編程時,我會更加關注這些細節。 – 2015-02-09 14:44:51