2016-06-12 59 views
0
/* 
@protocol ClasConfig 
@end 
*/ 

//class A 
@interface ClassA : NSObject 
    @property (nonatomic) *companyA; 
    @property (nonatomic) NSArray *companyLists; 

    - (NSMutableArray*)getCompanyLists:(CompanyListModel *)productionListModel; 
@end 

//class config 
@interface ClasConfig : NSObject 

    @property (nonatomic) NSString *Number; 
    @property (nonatomic) NSString *totalNumberOfCompany; 
@end 


@implementation ClassA 
- (NSMutableArray*)getCompanyLists:(CompanyListModel *)productionListModel 
{ 
ClasConfig *config = [[ClasConfig alloc] init]; **//Gives me linker error** 
} 
@end 

ClasConfig * config = [[ClasConfig alloc] init]; //給我鏈接錯誤 雖然我已經嘗試導入協議以供參考。

+0

我想你錯過了'@implementation ClasConfig @ end'。 – KudoCC

+0

@KudoCC謝謝。我已經回答了。是的,我錯過了。 –

回答

0

爲了實現ClassConfig的類。

@implementation ClassConfig 
@end 

@implementation ClassA 
- (NSMutableArray*)getCompanyLists:(CompanyListModel *)productionListModel 
{ 
ClasConfig *config = [[ClasConfig alloc] init]; **//Gives me linker error** 
} 
@end 
相關問題