I keep reading this point syntax, but I keep getting errors that the structure does not contain the members that I refer to. Perhaps this is not a point syntax, so I have included details of what I am doing in the hope of a solution:
#import <Foundation/Foundation.h>
@interface MobRec : NSObject {
@public NSString *mName;
@public int mSpeed;
}
@property (nonatomic, retain) NSString *mName;
@property (nonatomic) int mSpeed;
@interface Mobdefs : NSObject {
@public NSMutableArray *mobInfo;
}
@property(assign) NSMutableArray *mobInfo;
-(void) initMobTable;
@end
#import "Mobdefs.h"
#import "Mobrec.h"
@implementation Mobdefs
@synthesize mobInfo;
-(void) initMobTable
{
[mobInfo objectAtIndex:0 setmName: @"doug"];
mobInfo[1].MName = @"eric";
}
MobDefs *mobdef;
mobdef = [[Mobdefs alloc] init];
[mobdef initMobTable];
although both methods should work, I get erros on both. What am I doing wrong? My best thoughts were that I was using the wrong @property, but I think I tried everything. I do the highlighting mostly. Ideally, I would like to use this point-to-point syntax and cannot understand why it does not allow it.
source
share