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.

Thursday, December 1, 2011

Beyond/Nerdiosity: Rap battles

Dudes!


Here are two videos that you'll crack you head of, so just have fun.
Aqui vai dois videos para você se divertir.




Einstein X Stephen Hawking




Vader X Hitler



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.


Thursday, October 6, 2011

Cocos2D: Press&Hold button

Hey, sports!


Today the time is really really short, so I made an example and uploaded it.
It's no a virus or anything, it's a project that can help you when you need to make action like this:


1)Press button;
2)Wish that it would increase/decrease a "number label";
3)Release button;
4)Action stop right after releasing




                                           here's the link:
                   Project: Button Press&Hold


Hasta la vista, dudes.

Monday, October 3, 2011

AdMob/Cocos2D: How to implement Admod using Cocos2D

How's it going, bros?


Here's another post for those who want to try to make some money with Ads, specifically with AdMob - Google solutions for apps in your mobile application.


If you're just looking for the standard stuff for a UIViewController you can go directly to the GoogleCode page:


http://code.google.com/mobile/ads/docs/ios/fundamentals.html

Real easy instructions, almost thought that they should put on the title: "AdMob implementation for Dummies" (that's why i used :) ).


But if you are a avid Cocos2D programmer and are cracking you head of testing your options and not getting a good tutorial here it goes:


*Using: Cocos2D 1.0.1


1)Follow Google's link instructions till the part it shows the ".h" file;
2) Include what's not there:


//MyCoolApp.h


#import "GADBannerView.h"
#import "RootViewController.h"


@interface MyCoolApp : CCLayer {
    
    GADBannerView *bannerView_; 

    
    NSTimer* refreshTimer;
    NSInteger elapsedTime;
    NSInteger minutes;
    NSInteger seconds;



}



@property(nonatomic, retain)NSTimer* refreshTimer;

//YES I DID START THIS METHOD WITH UPPER CASE (:
-(void)AdMob;
-(void)removeSubviews;

-(void)targetMethod:(NSTimer *)theTimer;




//MyCoolApp.m

@synthesize refreshTimer;





//AdMob code

-(void)AdMob{
    NSLog(@"ADMOB");
    
    CGSize size = [[CCDirector sharedDirector] winSize];
    bannerView_ = [[GADBannerView alloc]
                   initWithFrame:CGRectMake(0.0, size.height-GAD_SIZE_468x60.height-720,GAD_SIZE_468x60.width,GAD_SIZE_468x60.height)];
    
    bannerView_.adUnitID = @"BUNCH_OF_NUMBERS_ADMOB_GIVES_YOU";
    bannerView_.rootViewController = self;
    [[[CCDirector sharedDirector]openGLView]addSubview:bannerView_];
    [bannerView_ loadRequest:[GADRequest request]];
}



//best practice for removing the barnnerView_

-(void)removeSubviews{
    NSArray* subviews = [[CCDirector sharedDirector]openGLView].subviews;
    for (id SUB in subviews){
        [(UIView*)SUB removeFromSuperview];
        [SUB release];
    }
}

//this makes the refreshTimer count
-(void)targetMethod:(NSTimer *)theTimer{
    
    //INCREASE OF THE TIMER AND SECONDS
    elapsedTime++; 
    seconds++;
    
    //INCREASE OF THE MINUTOS EACH 60 SECONDS
    if (seconds>=60) {
        seconds=0; minutes++;
        [self removeSubviews];
        [self AdMob];
    }
    NSLog(@"TIME: %02d:%02d", minutes, seconds);
}






-(id)init{
    
    if( (self=[super init])) {
             refreshTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(targetMethod:) userInfo:nil repeats:YES];
            [self AdMob];
    }
    return self;
}



3)Just be happy!




Hope this helps you guys, if you have any problems just get in contact.



Tuesday, September 27, 2011

Android/Eclipse: How to install Andoid SDK and Eclipse

Good morning, champs.
This will be a totally different post, till know you guys only saw iOS stuff and these things, from now on you'll have Android  (:


So for a good start, here's a tutorial, presented by a former coworker and JDS CEO, Jonathan Silva(@JonathanProfile), just press the little green fellow down here and turn on you Google Translation if you don't understand portuguese.



*If you guys have any problems understanding, please get in contact and i'll see if there would be any possibility in translating it.

Saturday, September 24, 2011

Pixelmator: Round Corners

Quick tip for those who do not use the Adobe Suit:


If you need to create round corners on a object, here it is:




Do not forget to "LIKE" this video.

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. 

Cocos2D: How to create a "Credits" scene

How's it going, bros!?


Here's another fast a simple post to help you enhance you app and consolidate you name on the credits:




#import "cocos2d.h"
#import "CCLayer.h"
#import "MainMenu.h"

@interface Credits : CCLayer{
    CCMenu* GAME_CREDITS;
}

+(CCScene *)scene;
-(void)runAnimation:(CCNode *)node;
-(id)init;

@end






#import "Credits.h"


@implementation Credits

+(CCScene *)scene{
    
    CCScene *scene = [CCScene node];
    Game *layer = [Credits node];
    [scene addChild:layer];
    return scene;
    
}

-(void)backToMenu:(id)sender{
    [[SoundManager sharedSoundManager] playSound:@"TOUCH"];
    CCScene* _scene = [MainMenu scene];
    [[CCDirector sharedDirector]replaceScene:[CCTransitionMoveInL transitionWithDuration:1.0 scene:_scene]];
    
}

-(void)doIt{
    [self runAnimation:GAME_CREDITS];
}

-(void)removeMe:(CCNode*)node{
    //NSLog(@"ENTROU NO REMOVE ME");
    GAME_CREDITS.position = ccp(CENTER_X, CENTER_Y*(-1)+(-100));
    [self runAnimation:GAME_CREDITS];
}

-(void)runAnimation:(CCNode *)node{
    
    [node runAction: [CCSequence actions: [CCMoveTo actionWithDuration:15.0 position:ccp(CENTER_X,CENTER_Y*3+150)], 
                                          [CCCallFuncN actionWithTarget:self selector:@selector(removeMe:)],nil]];
}

-(void)credits{
    //NSLog(@"ENTROU NOS CREDITS");
    [self runAnimation:GAME_CREDITS];
}

- (id)init
{
    self = [super init];
    if (self) {
        
        CCSprite* background = [CCSprite spriteWithFile:@"SV-BACKGROUND.png"];
        background.position = ccp(CENTER_X, CENTER_Y);
        [self addChild:background z:1];
        
        CCLabelTTF* BACK_N = [CCLabelTTF labelWithString:@"+BACK" fontName:FONT1_1 fontSize:MENU_ITEM_SIZE]; BACK_N.color = ccBLACK;
        CCLabelTTF* BACK_S = [CCLabelTTF labelWithString:@"+BACK" fontName:FONT1_1 fontSize:MENU_ITEM_SIZE]; BACK_S.color = ccGRAY;
        CCMenuItem* iBACK = [CCMenuItemSprite itemFromNormalSprite:BACK_N selectedSprite:BACK_S target:self selector:@selector(backToMenu:)];
        
        CCMenu* back = [CCMenu menuWithItems:iBACK, nil];
        back.position = ccp(CENTER_X-115, CENTER_Y-150);
        [self addChild:back z:3];
        
   
        CCLabelTTF* LABEL_0 = [CCLabelTTF labelWithString:@"0" fontName:FONT0 fontSize:20];
        CCLabelTTF* LABEL_N = [CCLabelTTF labelWithString:@"N" fontName:FONT0 fontSize:20];
        LABEL_0.color = ccBLACK;
        LABEL_N.color = ccBLACK;
        
        CCMenuItemLabel* iLABEL_0 = [CCMenuItemLabel itemWithLabel:LABEL_0];
        CCMenuItemLabel* iLABEL_N = [CCMenuItemLabel itemWithLabel:LABEL_1];
        
        
        GAME_CREDITS = [CCMenu menuWithItems:iLABEL_0, iLABEL_N,  nil];
        
        GAME_CREDITS.position = ccp(CENTER_X, CENTER_Y*(-1));
        [GAME_CREDITS alignItemsVerticallyWithPadding:5];
        [self addChild:GAME_CREDITS z:2];
        
        [self performSelector:@selector(credits) withObject:self afterDelay:1.7];
    }
    
    return self;
}

@end


Monday, September 19, 2011

Cocos2D: How to install it?

Now that i successfully got it installed here's the step-by-step:


1)Get the Cocos2D stuff;
2)Open your TERMINAL;
3)Go to the directory you downloaded the Cocos2D stuff;
4)After that just bring the .sh file (install-templates.sh) in to the code line;
    4.1)if you're not an administrator, you'll neet to put sudo before everything in the line and after you'll need to put the admin password;
5)Open Xcode and be happy.


Good luck (:

Cocos2D: How to remove it?

Just a fast note on how to delete it.
I had to delete it because the installation got kind of crapy, so here it goes:


1) Open TERMINAL
2) Execute these steps:
    2.1) cd/
    2.2) cd Library/
    2.3) cd Application/
    2.4) cd Developer/
    2.5) cd Xcode/
    2.6) cd Templates/
    2.7) ls (just to confirm that the cocos2d is in there)
    2.8) rm -rfd cocos2d-iphone-1.0.1/
     2.9) ls (just to confirm that the work is done)
3)Open Xcode an the the little devils wont be there.




good night!

Thursday, September 1, 2011

Google Developer's Day: Task Accomplished

Yo, dudes!


It's time for a fiesta!
I'm in for Google Developer's Day 2011, how freaky can it get, huh?
Well, as soon as i have some time, i'm going to continue coloring the sacred code that made me get in but on the mean time i just have to thank Adonai for all the support and good code insights and to my company that held me warm for the 5 or 6 frenetic-coding-hours.


And here is the proof that i'm not playing you guys around:




So that's that and see yall next post.

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