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

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월 17일 수요일

[Cocoslive] How to get a score from Cocoslive? Here it is!


I was gonna post it tomorrow but i decided to post it right now. why?

cause i dont have anything to do right now :p

Get to the point!


#import "CLScoreServerPost.h"

-(void) requestGlobalScore
{

    CLScoreServerRequest *request = [[CLScoreServerRequest alloc]initWithGameName:@"Mayday Timeattack" delegate:self];
  
    
    [request requestScores:kQueryAllTime limit:10 offset:currentScoreflags:kQueryFlagIgnore];

    [request release];
}
 
-(void) scoreRequestOk: (id) sender
{
    NSArray *scores = [sender parseScores]; 
    NSMutableArray * serverScore = [NSMutableArray arrayWithArray:scores];
}
 
 

Try the above lines then you will be find. 

If you have any questions, reply~

2011년 8월 16일 화요일

[IPhone Dev] How to create a .plist file for Frame Sheet Animation

http://zwoptexapp.com/flashversion

go to the above site and try below~


1. File - Import Images 
2. Arragne - By Name & Height
3. File - Export Coordinates


Pretty easy huh?



Mayday Timeattack - Free on Appstore


[IPhone Dev] CGPoint in NSMutableArray

Cannot use NSMutableArray with CGPoint.


In .net we use like this


List<CGPoint> list;


but since we don't have that in objective-c, we use this.


NSMutableArray * pointArray = [NSMutableArray array];
        
[pointArray addObject:[NSValue valueWithCGPoint:location]];
[pointArray addObject:[NSValue valueWithCGPoint:lastPoint]];
        
CGPoint retrievedPoint = [[pointArray objectAtIndex:0CGPointValue];
 
no more words to say.


That's all~



Mayday Timeattack - Free on Appstore


[IPhone Dev] How to CGPoint compare? Here it is!

CGPoint a, b;
if(a == b)



The above codes does not work;; Ah~~~ no~~~


so you have to use below.



if (CGPointEqualToPoint(location, lastPoint)) {


    }

 



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



[IPhone Dev]"This game is not recognized by Game Center" Problem

Straight to the point.

When get "This game is not recognized by Game Center" alert view when you are trying to add Game Center in you app on the device

but works on the simulator, well you are in no problem.

Just remove your app from the device and run on the device again.

It will work. Just got the problem and solved this problem after looked at this thread.

Thanks to Paul.


Mayday Timeattack - Free on Appstore


and now small talk :p

i used cocos2d and cocoslive for 
my game.

But i decided to go for Game Center. 

I haven't tried the "Campaign" from the admob site but i will try it layer.

Anyway looks like somehow they promote itself by "friends thing".

So.. i will update it with Game Center and see how it goes :p

Good day guys~