Having some difficulty with what I thought would be straight forward. I am trying to make an array of class objects but running into different problems. The goal was to create one class that held an array of another class of objects.
Any help appreciated:
// Basic class unit
@interface MobRec : NSObject {
NSString *MName;
int Speed;
}
@end
// Master Class holding an array of units
@interface MobDefs : NSObject {
MobRec *MobInfo;
}
@property(retain) MobRec *MobInfo;
@end
@synthesize MobInfo;
1) From reading it seems I should create and NSMutableArray but how do you declare an NSMutableArray of custom class objects? All iterations I try cause errors. Previously I had predefined the size in the class as MobInfo[20]; but that didnt seem to be good for anything.
2) How do you properly @Synthesize an array of class objects?