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

2011년 8월 20일 토요일

[IPhone Dev] 2 Button Alertview example.


Try the following~

UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Title"message:message delegate:self cancelButtonTitle:@"Cancel"otherButtonTitles:@"OK"nil];
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {

    if (buttonIndex == 0)   //NO
    {
        
    }
    else    //OK
    {
        
    }
}



That's all~

2011년 8월 16일 화요일

[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