#import <Foundation/Foundation.h>
#import "Asset.h"
@interface Person : NSObject{
int pin;
NSMutableArray* assets;
}
@property int pin;
-(void) addAsset: (Asset*) iasset; //producing error
@end
尝试编写包含“资产”数组的“Person”类的接口。线
-(void) addAsset: (Asset*) iasset;
产生错误。XCode 说,“期望一个类型”。有人可以告诉我哪里出错了吗?我可以提供所需的任何其他代码。
资产.h:
#import <Foundation/Foundation.h>
#import "Person.h"
@interface Asset : NSObject{
NSString* label;
int value;
Person* holder;
}
@property int value;
-(void) setHolder: (Person*)iholder;
-(void) setLabel: (NSString*)iname;
@end