My thoughts after using Three20 for an iOS project

I’ve recently completed an iOS project where I decided to use Three20 to implement a launcher style view.
I’d read about a lot of apps that use Three20 and thought it would be a good framework to get the hang of. Little did I know the struggle that I would have.

The first thing I had trouble with was finding good documentation. There seems to be a lot of example around the web on all sorts of Three20 stuff but none of it is really catered for beginners. I struggle for a long time just trying to get it installed and working properly. I could’t even find a simple up and running tutorial.

The second thing I had trouble with was getting community help. I subscribed to the Three20 mailing list and also joined the irc channel. Numerous times I posted asking for help on the mailing list only to have it go unanswered. My attempts to start conversations and ask for help on IRC also failed. I even sat in the channel for a number of days, every so often saying hi or hello, but no-one replied.

In the end I gave up on the mailing list and also IRC.

I stumbled my way through the app development process all the while feeling like I was being held back by Three20 rather than being empowered. It got to the stage where I felt locked into using Three20 due to my use of it URL navigation scheme. I did try to find an easy way to remove Three20 from my app but that also was a struggle that I gave up on and just battled on.

In a way it did make me learn it better, but overall I’ve hated the experience and its actually turned me off ever using another complex framework again.

In the future I’ll be sticking with simple frameworks that do a very specific thing. For everything else I’ll use the native iOS API’s and manually build what I need. At least the I know I’ll have more luck with finding help if I need it.

Perhaps once my skills get better, using Three20 (or Nimbus) will be a easier. I highly recommend beginners steer clear of it though.

Custom NSTableViewCell labels not appearing

I’m working on an iPhone app at the moment that is being upgraded from a previous version. I decided early on to just build on the existing code rather than trying to reinvent the wheel.

I’ve spent a bit of time fixing warnings that have cropped up from changes in the iOS SDK (the original app was developed for iOS 2) but one problem in particular had me stumped for a while.

When subclassing NSTableViewCell, the old init method was:

- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier

but somewhere along the line the init method definition changed to:

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

I’m yet to find out when this changed occurred, but it left me with the problem of no longer having access to the “frame” parameter. This meant the code in the init method that used to size the views of the custom cell no longer had a point of reference.

It took me a while to figure out that due to this change there was also another new method introduced that now had to be overridden to size the custom cell views:

-(void)layoutSubviews

In this method is where we are now meant to set the size of the custom cell views.

So I commented out the sizing code that used to be in the init method and moved it to the new layoutSubviews method as follows:

-(void)layoutSubviews
{
    [super layoutSubviews];
    CGRect label, steps;
    CGRect bounds = [[self contentView] bounds];
    label.origin.x = 20.0;
    label.origin.y = 3.0;
    label.size.height = bounds.size.height - (label.origin.y*2);
    label.size.width = 160.0;
    [dateLabel setFrame:label];

    steps.origin.x = 170.0;
    steps.origin.y = 5.0;
    steps.size.height = bounds.size.height - (steps.origin.y*2);
    steps.size.width = 120.0;
    [stepsLabel setFrame:steps];
}

This fixed my issue. Running the app now showed the custom cell labels as expected.