我有这两个类MobRec & MobDef,我想引用MobRec中的(MobDef)* mobInfo数组指针。 #输入MobRec.h或.m中的mobdefs.h文件,但没有运气有任何想法?Objective C一个类没有看到其他的
MobRec.h
// Basic class unit
@interface MobRec : NSObject {
NSString *mName;
int speed;
}
@end
MobDef.h
// Master Class holding an array of units
@interface MobDef : NSObject {
NSMutableArray *mobInfo;
}
@property(retain) NSMutableArray *mobInfo;
@end
MobDef.m
@synthesize MobInfo;
- (id)init { // to add a new node and initialize it
mobInfo = [[NSMutableArray alloc] init];
MobRec *aNewMobRec = [[MobRec alloc] init];
[mobInfo addObject:aNewMobRec];
[aNewMobRec release];
}
这只是一个错误的帖子谢谢。 – user240272 2009-12-31 03:01:20