2012-07-03 152 views
1

它給出未知類型名稱錯誤。我也導入了「billSummary」類,但不知道爲什麼xcode給出這個錯誤。未知類型名稱錯誤Iphone

#import <UIKit/UIKit.h> 
    #import "customiseForItems.h" 
    #import "billSummary.h" 

    @interface itemsInParty : UITableViewController<UIAlertViewDelegate>{ 
     IBOutlet customiseForItems *tblCell; 
     IBOutlet UIToolbar *billSummaryTool; 

     CGFloat percValue; 
     billSummary *billSummaryToShow;  //ERROR UNKNOWN TYPE NAME BILL SUMMARY 
     UIAlertView *alertForPercentage; 
     NSMutableArray *selectedEntriesPath; 
     BOOL descTapped; 
    } 

回答

3

寫的@class billSummary;代替#import "billSummary.h"

嘗試這樣就會對你有所幫助。

+1

嗯,它有幫助。我可以問爲什麼要使用@class而不是#import? –

+0

當然。看到這[鏈接](http://stackoverflow.com/questions/9743432/import-header-files) –

0

一個可能的原因是:

billSummary.h

@interface billSummaryMisspelled : ParentClass 
@end 

billSummary.m

@implementation billSummaryMisspelled 
@end 

文件名=你的類名

你可以使用正類聲明跳過該錯誤,

@class billSummary; 

而不是#import