-(NSArray*)createArrayOfChunks{
ProceduralMapGeneration *procedure = [[ProceduralMapGeneration alloc]init];
[procedure initArrays];
NSMutableArray *arrayMutable = [[NSMutableArray alloc] init];
SKNode *object;
for (int i = 0; i <= 19; i++) {
object = [procedure createChunk];
[arrayMutable addObject:object];
}
NSArray *array = [arrayMutable copy];
return array;
}
if I create an array like so and then call the method here in another method
_arrayOfChunks = [self createArrayOfChunks];
but now I want to edit _arrayOfChunks[0].position
when I attempt to do this
_arrayOfChunks[0].position = CGPointMake(screenSizeHalfW, screenSizeHalfH-100);
I get an error
Property 'position' not found on object of type 'id'
now as you saw before when i used createArrayOfChunks:
it made and instance variable object
which is a pointer to SKNode
so why is it telling me it has no property called position? how do i fix this?