레이블이 mayday인 게시물을 표시합니다. 모든 게시물 표시
레이블이 mayday인 게시물을 표시합니다. 모든 게시물 표시

2011년 8월 16일 화요일

[IPhone Dev] NSMutableArray Bad Access -while NSMutableArray reading

nonatomic


That's the one we have to know.


Im not describe what it is because that is not you wanna know :p


So i just get to the point.


if you get bad access error when you read a NSMutableArray, you may wanna use the array in @property way.


make it as a property then use like this


self.dotArray




@property (nonatomic, retain) NSMutableArray *dotArray;
  



Mayday Timeattack - Free on Appstore


[IPhone Dev] Get point from touch

 Getting location for touch!
 
Get the position!

-(void)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *touch = [touches anyObject];
    CGPoint location = [touch locationInView:touch.view]; 
}



Mayday Timeattack - Free on Appstore

[IPhone Dev] Objective C - Singleton

That's the one im using!

+ (GameManager *)sharedGameManager
{
    static GameManager *singletonClass = nil;
    
    if(singletonClass == nil)
    {
        @synchronized(self)
        {
            if(singletonClass == nil)
            {
                singletonClass = [[self alloc] init];
            }
        }
    }
    
    return singletonClass;
}

Mayday Timeattack - Free on Appstore