HTML Color to UIColor

This is a nice tool i’d like to share with you. While skinning your app, you might need to convert HTML color codes into those that are actually accepted by UIKit framework (which, by the way, is HEX!).

So… you need to fire Photoshop, or find a website that does that for you. Well, i just found a nice app called HexColors. It’s in the Mac AppStore, and it’s free (go get it!).

It allows you to convert html colors, straightforward, into an ObjectiveC NSColor… which, by the way, looks like this:

[NSColor colorWithCalibratedRed:0xFF/255.0 green:0xFF/255.0 blue:0xFF/255.0 alpha:0xFF/255.0]/* FFFFFFFF */

So… if you’re also working on iOS, you just need to weak that sentence to look like this:

[UIColor colorWithRed:0xFF/255.0 green:0xFF/255.0 blue:0xFF/255.0 alpha:0xFF/255.0]/* FFFFFFFF */

I know. That’s an extra step you have to take. There is also another version that actually has UIColor support, but it’s a paid app… and… i don’t mind replacing two words… it’s not THAT much, right?.

I hope you find it useful!

UITableViewCell without borders!

Suppose that you have an UITableView with a borderColor. Everything is cool and easy… as long as you don’t need to break the mold.

But if you ever need to add just ONE single cell without borders, you’ll notice that there is no way to do it. Well, it turns out that there is. But it’s not a straightforward one. You simply need to do this:

UIView* emptyBackView = [[UIView alloc] initWithFrame:CGRectZero];
[cell setBackgroundView:emptyBackView];

[emptyBackView release];
emptyBackView = nil;

Magic, ha?. If you add an empty backgroundView (with its background set to clearColor), the cell’s border will be gone.

I’ve been using this trick since iOS 3.1.2 times… and it’s still valid for iOS 5.1, so go ahead, and get rid of those borders!

Foo Fighters in Argentina!!!

I’ve been to Foo Fighters concert in River Plate. Let me tell you something about this band…. THEY ROCK!!!

It clearly was the best concert i’ve ever been to. It seemed that they actually enjoyed playing. Other big bands, such as AC/DC or Rolling Stones, seem to play just to make money. But they… they took the stage while it was raining. And no, they didn’t have a roof covering them.

They played for almost 3 hours… and we even got Grohl to play drums, which was the closest thing to listening to Nirvana (live) i’ll ever get. THANK YOU!

I just wanna paste here the tracklist, because… i don’t wanna forget about that… ever!.

01 – All My Life
02 – Times Like These
03 – Rope
04 – The Pretender
05 – My Hero
06 – Learn to Fly
07 – White Limo
08 – Arlandria
09 – Breakout
10 – Cold Day in the Sun
11 – Long Road to Ruin
12 – Big Me
13 – Stacked Actors
14 – Walk
15 – Generator
16 – Monkey Wrench
17 – Hey, Johnny Park!
18 – These Days
19 – This is a Call
20 – In the Flesh? (Pink Floyd Cover)
21 – Best of You
22 – Enough Space
23 – For All the Cows
24 – Dear Rosemary
25 – Bad Reputation (Joan Jett cover)
26 – Everlong

OSX: Renaming Fonts (For Free!)

I just got a huge problem. I’m working on an iOS app, and it turns out that we need to maintain compatibility with iOS 4. So… the problem is that we use custom fonts. A lot of them. That shouldn’t be an issue. BUT… i got to notice that iOS 4 supports up to two different fonts per family.

Long short story, if you’ve got a font family with… 5 different fonts, iOS 4 will load just two of  them. So how do we solve it?.

Simple!. We rename some of the extra fonts. Thing is, there are lots of tools to do that. But they’re paid. And… dude, it’s just renaming a font!. That’s where TTX comes in.

TTX is an opensource tool that basically converts a font into a readable XML. So… you just need to parse your OTF file, change the font name… and run TTX again, to pack it up into an OTF file, back again.

So far so good. But i was getting an error while trying to run TTX on OSX 10.7.3. The problem is that TTX works fine only in 32 bits mode.

So…. if you’re also having problems, just run this command, and you’re good to go:

defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

Buenos Aires Places: Brew Bars

I felt like i had to post this, you know?. There are loooots of bars in Buenos Aires. But few of them actually have a great variety of beers. I spent most of my weekends, during the past ten years, finding the best places to go.

And it turns out… there is nothing like staying at home. Yeah, i might sound like an old man. But if you go to a bar, you cannot drive for two good reasons. The police might take your car, or even worse, you won’t be able to find a parking spot. Okay, that might sound backwards… but anyways.

If you still wanna go out to a brew pub, i’d like to recommend few of them…

  • Van Koning
    This one used to be my point of reunion for years. It’s a nice place, located in Las Cañitas, Belgrano. They have a wide variety of beers. It’s pretty expensive, though.
  • Buller
    They produce their own beers. Again, this is a very expensive place. But i dare to say, it’s worth every single penny. If you go there, ask them a Honey Beer. You won’t regret it.
  • Antares
    They’re sort of Buller’s competition. They match them in quality, and in price. The huge advantage they have is their locations. You can find an Antares righ there, in Las Cañitas (2 blocks away from Van Koning), and yet another one 3 blocks away from La Viruta. No surprise, this is the place i like the most.