2012-07-03 154 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