I'm declaring an array of primitives on one of my objects, and cannot seem to access it from the outside. I'm fairly new at ObjectiveC, is there some obvious mistake I'm making?
header file:
@interface MyObject : NSObject {
//@public <-- this shouldn't be necessary, right? I have accessors!
float *d;
}
@property float *d;
.m file:
@synthesize d;
-(id) init {
...
self.d = (float*) malloc(sizeof(float) * n); //n > 1000
...
}
location performing the access:
MyObject* k = [MyObject init];
NSLog(@"%f",k.d[0]);
I receive an EXC_BAD_ACCESS error at the last line, though I can't seem to find a reason why that's true. Anyone see something I'm missing?