문제

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