Вопрос

I am very shaky on what it is instance variables (or ivars) are meant to achieve when they are class names. I know this is a basic Objective-C principle, but I want to give it some relevancy when working with cocos2d.

For example in this interface:

@interface BulletCache : CCNode {

CCSpriteSheet* batch;
}

The CCSpriteSheet class (now updated to CCSpriteBatchNode, but this is an older v of the engine) has an instance that is an instance variable of BulletCache.

But what exactly does this mean? What does it allow BulletCache to do that it couldn't do before?

Это было полезно?

Решение

After having talked to several programmers, it seems that instance variables consist of types and classes that this class owns--thus they are setup for autorelease in the dealloc method at the bottom of the class.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top