Hello people.
I have a problem/question on making a pointer to an array object.
This is an example:
CCSprite *sprite = [Array objectAtIndex:0];
[self addChild:sprite];
So like this, I want to make a separate sprite having data of an array's object.
I made another class for the array and made subclasses for each object in the array.
I put information about sprites in the subclasses (like image and methods), and just declared the object using the above line;
The app crashed on "addChild assert" and I soon realized that the app crash because of this:
[self addChild:sprite]; (Used breakpoint)
I think this is a pointer problem, but I just don't know a way to fix it, so it would be great if you guys tell me some suggestions to fix the problem.
It would also be great if you guys can just give me a link or something to remind me the properties of array (maybe I'm forgetting something).
If this question does not make any sense, feel free to ask me.
Thank you.