That iPhone Keypad

Finishing my series of copied flattered UIs, like that Facebook thingy or that Twitterriffic gadget, here’s Apple’s own iPhone keyboard, in a really sloppy implementation that has been blatantly and horribly copied, with awful sounds that pop when you tap the numbers and such. The Fring iPhone application uses a similar keyboard, but with a different color set.

This code, apart from showing the keyboard and playing those sounds, it doesn’t do anything else, even if a simple “tel:” URL call might suffice to turn it into a real dialer. As usual the code is on Github; feel free to play with it, extend it, and do what you want.

iPhone Font Browser

One of the most common questions I get when working with clients on iPhone apps is this one:

Which fonts can I use in iPhone apps?

I was surprised to see that the Xcode documentation does not bring a list of the fonts available in the iPhone OS (have I missed it? Is it somewhere else?), and I was happy to find this blog post the other day. Taking his idea as a basis, I’ve created a font browser for the iPhone which I’ve published in the projects section of this blog.

Feel free to play with the code! As usual, no warranties of any kind, but I’m already using it every day :)

iPhone Conference 2008 Geneva

Those of you who have been following this blog for the past years know that I have somewhat reduced my “writing rhythm” these days, and many factors have caused this. For the past 3 months I’ve been not only finishing my Master’s degree, but I started working as a full-time, independent iPhone developer, and soon some of my code will be available on the AppStore.

But in the meantime, I’m also starting a new business, and I’ve seen that many companies want to get into the iPhone application business in one way or another, and they have many questions.

To answer most of them all at once, and without breaking any NDA, we want to introduce you to The iPhone Conference 2008. This event is targeted to decision makers: whether you’re a CIO, CEO, marketing manager, responsible of corporate communications, we’ve got a message for you:

This event will be the first in Switzerland targeting the iPhone (that we’re aware of, of course). It will be held in Geneva, at the CICG, and it will be held in English. I think that there are huge business opportunities opening right now with the iPhone; I hope to meet you there!

The beauty of Cocoa

(Highly geeky post ahead. You’ve been warned!)

I have found the very message that summarizes the beauty of Cocoa in a single word; see by yourselves, hereunder in line 47:

[source:c]

import

// The interface of a person @interface Person : NSObject { NSString* firstName; NSString* lastName; int age; } @end

// The implementation of the Person @implementation Person -(id)init { if (self = [super init]) { firstName = @”"; lastName = @”"; age = 0; } return self; }

-(void)dealloc { [firstName release]; [lastName release]; [super dealloc]; }

-(NSString*)description { return [[NSString alloc] initWithFormat:@”Name: %@ %@, %d years old”, firstName, lastName, age]; } @end

// Some code using the Person class int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSMutableDictionary* dict = [[[NSMutableDictionary alloc] init] autorelease];
[dict setObject:@"Teto" forKey:@"firstName"];
[dict setObject:@"Rodriguez" forKey:@"lastName"];
[dict setObject:[[NSNumber alloc] initWithInt:34] forKey:@"age"];
Person* person = [[[Person alloc] init] autorelease];
// The beauty of Cocoa can be resumed to this very line:
[person setValuesForKeysWithDictionary:dict];
// Now sit back and relax:
NSLog([person description]);
[pool drain];
return 0;

} [/source]