Wednesday, August 13, 2014

HTML/TextWrangler: Mind bomb grep function

Hey,

Quick note.
I'm not a web developer, but often I need to manipulate something that the source comes from the web. So today I needed to get a lista of names, but they came full of HTML mambo jumbo and I was like: "OMFG! How am I gonna get this done".

So after a quick Google search this dude, Art Upton, just gave it all the steps I needed:

1. Put you file to be stripped
2. Command+F
3. Selecte the "grep" tick box
4. Put this magical function on the "Find" field: </?[^>]*>
5. Press "Replace All"
6. BOOM! Magic.

Get a look on the source of the magic: http://bcdwp.web.tamhsc.edu/webmaster/2011/08/12/how-to-strip-html-code-using-grep-in-text-wrangler/

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.

Friday, March 22, 2013

Install .apk via Terminal

Hi!

Quick tip to install apps via Terminal on your Mac.

1) download the adb tools;
2) got to the platform-tools or tools (can vary) were you adb were installed;
3) perform:  ./adb devices
        if you don't get this message: 
                "List of devices attached 
                'bund of numbers' device"
       try restarting you device
4) perform: ./adb install PATH/TO/YOUR/file.apk
5) Mazel tov! Your on dude.

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.

Wednesday, July 4, 2012

Lessons/Stanford: Programming Leassons

Hi!

Here's a quick tip for everyone who wants to learn more and didn't go to college or wants or simply enjoys to get as much information possible:


Enjoy!

PS. I mustn't forget to thank Caue for the hint, I already had atended to the iOS classes but didn't know about the others, so, "Thank you, Cauê (L)"

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.

Thursday, January 26, 2012

XCode/Archiving: Uploading Archive Problem

How's going, everybody?


Well, here's a quick tip on what can help you when you get the dreadful error while you're uploading your archive to the store:




'iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present'



This is a error that really sucks because, dudes! The last thing after 120 hours working on your code is an error for uploading the thing. But here is what you do:




1)Select your project "stuff" up there;
2)Select the "PROJECT" option;
3)Go to "Architectures";
4)Press on top of the up-and-down arrow;
5)Inserting the "armv6" thing:
    5.1) Delete any option that you have there:
        5.1.1)Select the option;
        5.1.2)Press the "-";
    5.2) Press the "+";
    5.3) Insert the "armv6";
    5.4) Probably you'll need to press some type of confirmation.




That's it.
Cheers.

Tweet