开发者

How do you turn sprites into objects , for mutable arrays?

I have a mutable array which stores sprites but the problem is that the sprites aren't objects and need to be created into objects so that they can be stored in the array, i am using cocos2d. Here is my code 开发者_Python百科so far.

    NSMutableArray  *sprites = [[NSMutableArray alloc] init]; int spritecount = 0;
    [sprites insertObject:red1 atIndex:spritecount++];
    [sprites insertObject:red2 atIndex:spritecount++];


If you are talking about CCSprites, they DO inherit from NSObject, so you should be able to insert them in a NSMutableArray.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜