I have started implementing a game in cocos2d-iphone; I'm using ARC in my project.
In the main @interface
of the class declared in my Levelfinder.h
, I have declared the following property:
@property NSMutableArray* pineapples;
In my main class, I am using this property:
for (PineappleModel* pineapple in levelFileHandler.pineapples)
{
b2Body* body = [self createPineappleAt:
[CoordinateHelper levelPositionToScreenPosition:pineapple.position]];
body->SetLinearDamping(pineapple.damping);
[pineapplesDict setObject:[NSValue valueWithPointer:body]
forKey:[NSNumber numberWithInt: pineapple.id]];
}
But when I run my code then I'm seeing the following runtime error:
SIGABRT '-[LevelFileHandler setPineapples:]: unrecognized selector sent to instance 0x9431c60
I am new to cocos2d, but have looked at this problem for a long time and am stuck. Any kind of help would be greatly appreciated.
Here is LevelFileHandler.h
@interface LevelFileHandler : NSObject
@property NSMutableArray* pineapples;
@end
Now in my LevelFileHandler.m
, i have used my pineapples property like this
self.pineapples = [NSMutableArray arrayWithCapacity:5];
[self.pineapples addObject:pineappleModel]
The intent of this code, clearly, is simply to create an array with a capacity of 5.