Showing posts with label OBJECTIVE-C. Show all posts
Showing posts with label OBJECTIVE-C. Show all posts

Monday, November 11, 2013

Xcode/Objective-C: ERROR - 'Missing routing app coverage file'

Hey!

It's been a long time since I last posted.
So today will see a tricky upload problem that makes no sense at first.

'Missing routing app coverage file: You must upload a routing app coverage file in iTunes Connect if you register as a routing app'


This error didn't take that much to be adjusted but has a shitty log message.

So you do this:

IF YOU DON'T EVEN KNOW WHAT'S THAT:

1) goto the left navigation bar and click on the "file" icon
2) click on the "project" icon (where you see your project's name)
3) select the "Capabilities" tab and unckeck any "Routing" options you have marked.

IF YOU KNOW WHATS THAT:

Probably while you were importing assets from your server/git you just lost file so double check and if need re-reference it.

WHAT'S THIS ABOUT?
(It's some type of rare elvish magic) In case you want to make routes using Apple's Mapkit you have to have the "coverage file".

Cheers.

Monday, February 25, 2013

Obj-c/UIDeviceOrientation: How to force the Device Orientation

Hi,

How's it going?
Today I got a fast tip in how to force your device orientation. Fast, quick and beautiful.

1) You have to put this piece of code somewhere in the class that you're using or in the AppDelegate. It's gonna depend on what you prefer, in my case I putted it in a specific class.


[[UIDevice currentDevice]beginGeneratingDeviceOrientationNotifications];


2) Add this to your .h or to the top of your .m . Do not forget to put something in the parenthesis different than 'Private', think something that Apple wouldn't use and put it their.


@interface UIDevice(MyDeviceInterface)
- (void) setOrientation:(UIInterfaceOrientation)orientation;
@end


3) Now be free to you this gorgeous method whenever you want in that specific class.


[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];


Enjoy!
Happy Coding.

Monday, May 14, 2012

Cocos2d/Gamecenter: How to implement correctly GameCenter into Cocos2d

Hi,

How's it going there?
Here's a tutorial that i saw loads of people having the same problem and after some research  I figured it out.

I don't know if it's the ideal way, but as it worked I can suit you.

Cocos2D: 1.0.1

What was the problem that it wouldn't work?
R: For some reason the RootViewController wasn't referenced and so it gave me a 12h delay on the project.

Step 1:

Go to you AppDelegate.h


#import <UIKit/UIKit.h>

@class RootViewController;

@interface AppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
RootViewController *viewController;
}

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) RootViewController *viewController;

@end



Step 2:

Go to your AppDelegate.m


#import "cocos2d.h"



#import "AppDelegate.h"

#import "RootViewController.h"

@implementation AppDelegate

@synthesize window;
@synthesize viewController;

- (void) applicationDidFinishLaunching:(UIApplication*)application
{
// Init the window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    window.rootViewController = viewController;
//blablablá
// Init the View Controller
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
}

Step 3:

Import GameKit.framework

Step 4:

Implement some code.
I'm going to put only some basic stuff and of course the most important the leaderboard.



-(void)localUserAuthentication{

    

    GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
    [localPlayer authenticateWithCompletionHandler:^(NSError *error) {
        if (!error){
            isLocalUserAuthenticated = YES;
            //NSLog(@"AUTHETICATION SUCCEDED");
        } else {
            isLocalUserAuthenticated = NO;
            //NSLog(@"AUTHETICATION FAILED");
        }
    }];
}





-(void)showLeaderboard{
    
    
    GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
    if (leaderboardController != NULL) {
        leaderboardController.category = @"com.yourcompany.gamename.leaderboard.whatleaderboard"; 
        leaderboardController.timeScope =GKLeaderboardTimeScopeAllTime;
        leaderboardController.leaderboardDelegate = self; 
        AppDelegate *delegate = [UIApplication sharedApplication].delegate; 
        [delegate.viewController presentModalViewController:leaderboardController animated:YES];
    }
    
    leaderboardController.toolbar.autoresizesSubviews = YES;
    leaderboardController.view.bounds = CGRectMake(0, 0, 480, 320);
    leaderboardController.view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(90));
}



-(void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController{
    CCMenu* gamemenu = (CCMenu*)[self getChildByTag:kGameMenu];
    gamemenu.isTouchEnabled = YES;
    [self show];
    
    AppDelegate *delegate = [UIApplication sharedApplication].delegate; 
    [delegate.viewController dismissModalViewControllerAnimated:YES];
}



Well, so that's that.
If you guys need any help, just get in contact.
Hasta luego.

Friday, December 2, 2011

XCode/Objective-C: Xcode 4.2 and MainWindow.xib

Bros,


After a long search on the Oracle (Google) I found it.
The on thing that really pissed me on XCode 4.2 (AKA last version), what that "View Based Application" does not exist anymore and i was like "WTFH am I going to do now?!".


So today, i found the solution!


Who found it out?


                       Joroen Trappers - click here and do directly to his solution/post


From whom did i get the first post?


                      Chris's Laboratory - click and go the post




If you guys need anything, just get in contact.
Live long and prosper, peace.

Friday, November 25, 2011

Objective-C/Cocoa: Star Rating Class

Hi breathers,


How's it all going?
It's been a time since i posted, so here's some nice stuff.


Know all those games that rate you after the match(e.g. Angry Birds) with the star system-thing, so i made on very simple so you just need to copy and paste on your project.


Download: StarRate Class (WARNING: Very Huge Dowload - 3K)


Probably you'll would like to add other sizes of banners, so just feel free to use the class as you want.


Oh, yeah! One last thing. I know this is a stupid comment, but remember you're not going to use it directly on the  "-(void)viewDidLoad". Normally you'll use it when the match is ended and on the "level" boxes to display the last rate the player had on that match/level.


After you import the code to your project you have to do this:



#import <UIKit/UIKit.h>

#import "StarRate.h"



@interface StarTestViewController : UIViewController{
    StarRate *_stars;
}

@end


#import "StarTestViewController.h"





@implementation StarTestViewController


-(void)createStars{
    _stars = [[StarRate alloc]init];

    //THIS setBackgroundColor YOU CAN ADD TO THE CLASS I UPLOADED FOR YOU
    //ON THE -(void)startUp METHOD
    [_stars setBackgroundColor:[UIColor clearColor]];
    [_stars setupInterfaceTheWayIWantWithType:STARBANNER_250X50 andRate:2];
    [_stars setCenter:CGPointMake(160, 240)];
    [self.view addSubview:_stars];
}


-(void)viewDidLoad{
    [self createStars];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    [super viewDidLoad];
}

(...)


@end






As you can see, i didn't use InterfaceBuilder, i'm kind of on strike with him, so fell free to use InterfaceBuilder if you want, you just need to remember how to inherit a normal UIView to StareRate.

If you need help, just go to the Contact Section and let me know.
Live long and prosper.


Saturday, September 24, 2011

App4U/Work: TwistMemory, SecretBalls, HungryFrog

*GREEN for English
*AMARELO para Português


Hi!


Here are the links for some of our apps:
Aqui estão os links para alguns dos nossos aplicativos:


#1 :  TWIST MEMORY:


http://itunes.apple.com/br/app/twist-memory/id457878965?mt=8




This is a memory twisting, psychedelic memory game. You just need to put up the pairs together as fast as you can in less then 5 minutes. Fun to spend you time and difficult stopping to play it.


Jogo que vai psicodelicamente pirar a sua memoria. Você só precisa juntar os pares o mais rápido possível, em menos de 5 minutos. Divertido para passar o tempo e difícil de parar de jogar.


*This was made with 100% legit code by Felipe Gringo(me) and Sergio Furlaneto Filho.


*Esse foi um código 100% feito por Felipe Gringo(eu) e o Sergio Furlaneto Filho.
        
#2: SECRET BALLS:


http://itunes.apple.com/br/app/secret-balls/id392074246?mt=8



This was the first app I put my hands on, so we worked like camels to do a new interface and bring some new stuff on it. It's just incredible. If you like a intelligent and nerdy game, this is the one for you. You just need to find out the right sequence and go to the next code, over and over!

Esse foi o primeiro aplicativo que me veio em mãos, então nós camelamos para fazer uma nova interface e trazer novas funcionalidades. Simplesmente incrível. Se você se interessa por jogos inteligentes e meio nerds, esse é pra você. Você só precisa acertar a sequência de cores e ir para o próximo código!

#3: HUNGRY FROG:



Wow, this kid here drove us crazy, it gave lot of work but the animations are spectacular, the game is fun and not so hard to play. You'll have to help this little green dude eat as many flies he can before the flies counter attack.

Wow, esse quase nos fez ir para em um sanatório, deu trabalho mas as animações ficaram espetaculares, o jogo é divertido e não é complicado. Você terá que ajudar esse carinha verde comer quantas moscas forem possíveis antes que as moscas contra-ataquem.


For more App4U apps go to: http://www.app4u.com.br/
Para mais aplicativos da App4U:  http://www.app4u.com.br/

If you want to get in contact with me go to CONTACT section.
Se quiser entrar em contato comigo clique na aba CONTACT. 

Friday, August 19, 2011

Google Developer Day / Objective-C: String Handling

Hi!

Here's the code i used for the Google Developer Day 2011, i wasn't able to come up with the 4th task, but it came to me a few hours later at home, so as soon as i code it, i'll update the post.

No way i can paint special words.
Sorry.

CODE:


#import <Foundation/Foundation.h>

@interface MyClass : UIViewController {
    
    IBOutlet UIButton* hitItButton;
    IBOutlet UITextField* TEXT;
    
    int VEZES_QUE_ENTROU;
    int VEZES_QUE_SAIU_SEM_SUCESSO;
    
    NSMutableString* POSITION_1;
    NSMutableString* POSITION_2;
    NSMutableString* POSITION_3;
    NSMutableString* POSITION_4;
    NSMutableString* POSITION_5;
    NSMutableString* POSITION_6;
    NSMutableString* POSITION_7;
    NSMutableString* POSITION_8;
    NSMutableString* POSITION_9;
    NSMutableString* POSITION_10;
    NSMutableString* POSITION_11;
    NSMutableString* POSITION_12;
    NSMutableString* POSITION_13;
    NSMutableString* POSITION_14;
    NSMutableString* POSITION_15;
    NSMutableString* POSITION_16;
    NSMutableString* POSITION_17;
    NSMutableString* POSITION_18;
    NSMutableString* POSITION_19;
    NSMutableString* POSITION_20;
    NSMutableString* POSITION_21;
}


@property(nonatomic, retain)NSUserDefaults* defaultz;

-(void)doIt:(id)sender;


@end


#import "MyClass.h"

@implementation MyClass

@synthesize defaultz;

-(int)intergerForTheString:(NSMutableString*)SINGLE_LETTER{
    
    int switcher;
    
    if ([SINGLE_LETTER isEqualToString:@"l"]){
        switcher = 0;
    }
    if ([SINGLE_LETTER isEqualToString:@"v"]){
        switcher = 1;
    }
    if ([SINGLE_LETTER isEqualToString:@"z"]){
        switcher = 2;
    }
    if ([SINGLE_LETTER isEqualToString:@"t"]){
        switcher = 3;
    }
    if ([SINGLE_LETTER isEqualToString:@"r"]){
        switcher = 4;
    }
    if ([SINGLE_LETTER isEqualToString:@"n"]){
        switcher = 5;
    }
    if ([SINGLE_LETTER isEqualToString:@"h"]){
        switcher = 6;
    }
    if ([SINGLE_LETTER isEqualToString:@"f"]){
        switcher = 7;
    }
    if ([SINGLE_LETTER isEqualToString:@"x"]){
        switcher = 8;
    }
    if ([SINGLE_LETTER isEqualToString:@"d"]){
        switcher = 9;
    }
    if ([SINGLE_LETTER isEqualToString:@"g"]){
        switcher = 10;
    }
    if ([SINGLE_LETTER isEqualToString:@"p"]){
        switcher = 11;
    }
    if ([SINGLE_LETTER isEqualToString:@"b"]){
        switcher = 12;
    }
    if ([SINGLE_LETTER isEqualToString:@"j"]){
        switcher = 13;
    }
    if ([SINGLE_LETTER isEqualToString:@"m"]){
        switcher = 14;
    }
    if ([SINGLE_LETTER isEqualToString:@"w"]){
        switcher = 15;
    }
    if ([SINGLE_LETTER isEqualToString:@"q"]){
        switcher = 16;
    }
    if ([SINGLE_LETTER isEqualToString: @"s"]){
        switcher = 17;
    }
    if ([SINGLE_LETTER isEqualToString:@"k"]){
        switcher = 18;
    }
    if ([SINGLE_LETTER isEqualToString:@"c"]){
        switcher = 19;
    }
    
    return switcher;
}


-(double)potenciacao:(double)X onTheTurn:(int)Z{
    
    double Y=0;
    
    if (Z==0){
        return 1;
    } else {
        Y=X*20;
    }
    
    return Y;
    
}

-(double)calculateIt:(NSString *)X{
    
    
    int TOTAL = [X length];
    int switcher=0;
    double TOTAL_A_ENTREGAR=0;
    double POTENCIACAO=20;
    NSMutableString* SINGLE_LETTER;
    
    for (int i=0; i<[X length]; i++){
        SINGLE_LETTER = [NSMutableString stringWithString:[X substringWithRange:NSMakeRange(i, 1)]];
        switcher = [self intergerForTheString:SINGLE_LETTER];
        
        POTENCIACAO = [self potenciacao:POTENCIACAO onTheTurn:i];
        
        TOTAL_A_ENTREGAR = TOTAL_A_ENTREGAR + switcher*POTENCIACAO; 
        TOTAL--;
    }
    return TOTAL_A_ENTREGAR;
}

-(BOOL)isItBonito:(double)X{
    
    BOOL RETURNER;
    
    if ((X > 865641) && (((int)X%3) == 0)){
        RETURNER = TRUE;
    } else {
        RETURNER = FALSE;
    }
    
    return RETURNER;
    
}

-(BOOL)isItAlreadyStocked:(NSMutableString *)X withLoopNumber:(int)Y{
    
    NSString* RECOVERED_STRING;
    BOOL COISA;
    int zzz;
    VEZES_QUE_ENTROU++;
    
    for (int i=1; i<=Y; i++){
        RECOVERED_STRING = [defaultz stringForKey:[NSString stringWithFormat:@"iz%d", i]];
        if ([X isEqualToString:RECOVERED_STRING ]){
            VEZES_QUE_SAIU_SEM_SUCESSO++;
            COISA = TRUE;
        }
        
    }
    
    if (COISA == TRUE) {
        return COISA;
    } else {
        
        zzz = VEZES_QUE_ENTROU-VEZES_QUE_SAIU_SEM_SUCESSO;
        [defaultz setObject:X forKey:[NSString stringWithFormat:@"iz%d", zzz]];
        return FALSE;
    }
}


-(BOOL)firstLette:(NSMutableString*)X{
    
    BOOL RETURNER;
    
    if ([X isEqualToString:@"x"]){
        RETURNER = TRUE;
    } else if ([X isEqualToString:@"q"]){
        RETURNER = TRUE;
    } else if ([X isEqualToString:@"g"]){
        RETURNER = TRUE;
    } else if ([X isEqualToString:@"p"]){
        RETURNER = TRUE;
    } else if ([X isEqualToString:@"r"]){
        RETURNER = TRUE;
    } else {
        RETURNER = FALSE;
    }
    
    return RETURNER;
    
}

-(IBAction)doIt:(id)sender{
    //NAO ESQUECE DE COLOCAR UM ESPAÇO NO FINAL
    NSString* ENTERING_STRING = @"THE STRING GOOGLE GAVE YOU TO FIND OUT STUFF";
    
    int WORD__COUNTER=0, SAVED_COUNTER=0, WHAT_LETTER_WE_ARE = 0, PREPOSITION_COUNTER=0, NORMAL_VERB_CONTER=0, FP_VERB_CONTER=0, D_LETTER=0, BONITO_COUNTER=0, OUTRO_BONITO_COUNTER=0;
    NSMutableString* SINGLE_LETTER, *WORD, *SINGLE_LETER_FOR_FIRST_PERSON;
    BOOL TIME_TO_SAVE_CONTER = YES, IS_IT_FOO = NO;
    NSMutableArray* array = [[NSMutableArray alloc]initWithCapacity:110];
    
    
    for (int x=0; x<[ENTERING_STRING length]; x++) {
        
        if(TIME_TO_SAVE_CONTER == YES){
            TIME_TO_SAVE_CONTER = NO;
            SAVED_COUNTER = x;
        }
        
        SINGLE_LETTER = [NSMutableString stringWithString:[ENTERING_STRING substringWithRange:NSMakeRange(x, 1)]];
        
        
        if ([SINGLE_LETTER isEqualToString:@" "]){
            WORD = [NSMutableString stringWithString:[ENTERING_STRING substringWithRange:NSMakeRange(SAVED_COUNTER, WHAT_LETTER_WE_ARE)]];            
            //NSLog(@"%@", WORD);
            int OCORRENCIA_FOO=0;
            
            WORD__COUNTER++;
            if (WORD__COUNTER == 1){
                [defaultz setObject:WORD forKey:[NSString stringWithFormat:@"iz%d", WORD__COUNTER]];
            }
            
            NSString* WORD_FOR_CAL = WORD;
            //NSLog(@"%@", WORD_FOR_CAL);
            
            if ([WORD_FOR_CAL isEqualToString:@" "]){
                NSLog(@"branco");
            } else {
                //NSLog(@"wordc: %d", WORD__COUNTER);
                BOOL REPETIDO = [self isItAlreadyStocked:WORD withLoopNumber:WORD__COUNTER];
                //NSLog(@"repetido: %d", REPETIDO);
                
                BOOL BONITO = [self isItBonito:[self calculateIt:WORD_FOR_CAL]];
                if (BONITO == TRUE && REPETIDO == FALSE){
                    BONITO_COUNTER++;
                    [defaultz setObject:WORD_FOR_CAL forKey:[NSString stringWithFormat:@"BONITO%d", BONITO_COUNTER]];
                    [array addObject:[defaultz stringForKey:[NSString stringWithFormat:@"BONITO%d", BONITO_COUNTER]]];
                }
            }
            
            [array sortUsingSelector:@selector(compare:)];
            
            for (int y=0; y<[WORD length]; y++){
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"x"]){
                    //NSLog(@"SOMOOU FOO");
                    OCORRENCIA_FOO++;
                }
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"q"]){
                    //NSLog(@"SOMOOU FOO");
                    OCORRENCIA_FOO++;
                }
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"g"]){
                    //NSLog(@"SOMOOU FOO");
                    OCORRENCIA_FOO++;
                }
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"p"]){
                    //NSLog(@"SOMOOU FOO");
                    OCORRENCIA_FOO++;
                }
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"r"]){
                    //NSLog(@"SOMOOU FOO");
                    OCORRENCIA_FOO++;
                }
                if ([[WORD substringWithRange:NSMakeRange(y, 1)] isEqualToString:@"d"]){
                    //NSLog(@"entrou");
                    D_LETTER++;
                }
            }
            
            //VERIFICA SE TEM FOO
            if (OCORRENCIA_FOO > 0){
                //NSLog(@"SIM ELE É FOO");
                IS_IT_FOO = YES;
                if (OCORRENCIA_FOO > 1){
                    //NSLog(@"%@ TEM %d LETRAS", WORD, [WORD length]);
                    //NSLog(@"FOO: %d OCORRENCIAS", OCORRENCIA_FOO);
                }
                else{
                    //NSLog(@"%@ TEM %d LETRAS", WORD, [WORD length]);
                    //NSLog(@"FOO: %d OCORRENCIA", OCORRENCIA_FOO);
                }
            } else {
                //NSLog(@"NAO É FOO");
                IS_IT_FOO = NO;
                //NSLog(@"%@ TEM %d LETRAS", WORD, [WORD length]);
                //NSLog(@"FOO: %d OCORRENCIA", OCORRENCIA_FOO);
            }
            
            
            if ([WORD length] == 3 && IS_IT_FOO == YES && D_LETTER <= 0){
                //NSLog(@"ESSA É UMA PREPOSIÇÃO");
                PREPOSITION_COUNTER++;
                IS_IT_FOO = NO;
                
            } else { 
                D_LETTER=0;
                //NSLog(@"ESSA NÃO É UMA PREPOSIÇÃO");
            }
            
            
            
            if ([WORD length] >= 8){
                SINGLE_LETTER = [NSMutableString stringWithString:[ENTERING_STRING substringWithRange:NSMakeRange(x-1, 1)]];
                SINGLE_LETER_FOR_FIRST_PERSON = [NSMutableString stringWithString:[ENTERING_STRING substringWithRange:NSMakeRange(SAVED_COUNTER, 1)]];
                
                if ([SINGLE_LETTER isEqualToString:@"x"]){
                    NORMAL_VERB_CONTER++;
                    if ([self firstLette:SINGLE_LETER_FOR_FIRST_PERSON] == TRUE){
                        FP_VERB_CONTER++;
                    }
                }
                if ([SINGLE_LETTER isEqualToString:@"q"]){
                    NORMAL_VERB_CONTER++;
                    if ([self firstLette:SINGLE_LETER_FOR_FIRST_PERSON] == TRUE){
                        FP_VERB_CONTER++;
                    }
                }
                if ([SINGLE_LETTER isEqualToString:@"g"]){
                    NORMAL_VERB_CONTER++;
                    if ([self firstLette:SINGLE_LETER_FOR_FIRST_PERSON] == TRUE){
                        FP_VERB_CONTER++;
                    }
                }
                if ([SINGLE_LETTER isEqualToString:@"p"]){
                    NORMAL_VERB_CONTER++;
                    if ([self firstLette:SINGLE_LETER_FOR_FIRST_PERSON] == TRUE){
                        FP_VERB_CONTER++;
                    }
                }
                if ([SINGLE_LETTER isEqualToString:@"r"]){
                    NORMAL_VERB_CONTER++;
                    if ([self firstLette:SINGLE_LETER_FOR_FIRST_PERSON] == TRUE){
                        FP_VERB_CONTER++;
                    }
                }
                
            }
            
            
            TIME_TO_SAVE_CONTER = YES;
            WHAT_LETTER_WE_ARE =0;
        } else {
            //NSLog(@"%@", SINGLE_LETTER);
            WHAT_LETTER_WE_ARE++;
        }
        
        
    }
    NSLog(@"VERBOS: %d", NORMAL_VERB_CONTER);
    NSLog(@"VERBOS EM 1P: %d", FP_VERB_CONTER);
    NSLog(@"PREPOSIÇOES: %d", PREPOSITION_COUNTER);
    NSLog(@"NUM. BONITOS: %d", BONITO_COUNTER);
    NSLog(@"TOTAL DE PALAVRAS = %d", WORD__COUNTER);
    
    NSString* string_De_retorno = [[NSString alloc]init];
    for (NSString* WWW in array) {
        NSLog(@"%@", WWW);
        [string_De_retorno stringByAppendingString:WWW];
    }
    
    TEXT.text = string_De_retorno;
    NSLog(@"%@", string_De_retorno);
    
}

-(int)count:(NSString*)String{
    int x = 0;
    for ( x=0; x <= [String length]; x++)
        NSLog(@"x");
    
    return x;
}

-(void)startMutableStrings{
    
    POSITION_1 = [NSMutableString string];
    POSITION_2 = [NSMutableString string];
    POSITION_3 = [NSMutableString string];
    POSITION_4 = [NSMutableString string];
    POSITION_5 = [NSMutableString string];
    POSITION_6 = [NSMutableString string];
    POSITION_7 = [NSMutableString string];
    POSITION_8 = [NSMutableString string];
    POSITION_9 = [NSMutableString string];
    POSITION_10 = [NSMutableString string];
    POSITION_11 = [NSMutableString string];
    POSITION_12 = [NSMutableString string];
    POSITION_13 = [NSMutableString string];
    POSITION_14 = [NSMutableString string];
    POSITION_15 = [NSMutableString string];
    POSITION_16 = [NSMutableString string];
    POSITION_17 = [NSMutableString string];
    POSITION_18 = [NSMutableString string];
    POSITION_19 = [NSMutableString string];
    POSITION_20 = [NSMutableString string];
    
}

-(void)stockString:(NSMutableString*)X withIndex:(int)Y{
    
    switch (Y){
        case 1: POSITION_1 = X; break;
        case 2: POSITION_2 = X; break;
        case 3: POSITION_3 = X; break;
        case 4: POSITION_4 = X; break;
        case 5: POSITION_5 = X; break;
        case 6: POSITION_6 = X; break;
        case 7: POSITION_7 = X; break;
        case 8: POSITION_8 = X; break;
        case 9: POSITION_9 = X; break;
        case 10: POSITION_10 = X; break;
        case 11: POSITION_11 = X; break;
        case 12: POSITION_12 = X; break;
        case 13: POSITION_13 = X; break;
        case 14: POSITION_14 = X; break;
        case 15: POSITION_15 = X; break;
        case 16: POSITION_16 = X; break;
        case 17: POSITION_17 = X; break;
        case 18: POSITION_18 = X; break;
        case 19: POSITION_19 = X; break;
        case 20: POSITION_20 = X; break;
    }
    
}


-(void)viewDidLoad{
    
    [self startMutableStrings];
    defaultz = [NSUserDefaults standardUserDefaults];
    VEZES_QUE_ENTROU=1;
    VEZES_QUE_SAIU_SEM_SUCESSO=0;
    [super viewDidLoad];
    
}


-(void)viewDidUnload{
    [super viewDidUnload];
 }

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{   
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end

Tweet