1
我在Github下載了這個tweejump應用程序。它好工作和Xcode 3.2.3,但現在我升級到4.2的Xcode,它顯示了在這一行錯誤:分配屬性只讀屬性不允許
cloud.opacity = 128;
語境:
- (void)initCloud {
CGRect rect;
switch(random()%3) {
case 0: rect = CGRectMake(336,16,256,108); break;
case 1: rect = CGRectMake(336,128,257,110); break;
case 2: rect = CGRectMake(336,240,252,119); break;
}
AtlasSpriteManager *spriteManager = (AtlasSpriteManager*)[self getChildByTag:kSpriteManager];
AtlasSprite *cloud = [AtlasSprite spriteWithRect:rect spriteManager:spriteManager];
[spriteManager addChild:cloud z:3 tag:currentCloudTag];
cloud.opacity = 128;
}
它說assigning to property with readonly attribute not allowed
。
什麼似乎是問題?我升級到xcode 4.2會影響它嗎?
我不知道該怎麼辦,因爲就像我說的,我只是下載了它......
這是cocos2d的0.8? – kennytm 2011-12-15 05:48:58