I won a Palm Pre

I went to Palm’s party for developers at 111 Minna tonight and this is what I went home with. They really want people to start developing for WebOS, so I plan to take advantage of this.

I won this

Quick and easy image caching for UITableViews

PicSlide uses a table that lets you choose a picture to play with. For each picture it shows a thumbnail. When the thumbnails are loaded from the application’s resources, you don’t have to be too concerned with image loading time.However, when I load those thumbnails from the web, as I do now with the Magic Panda, scrolling the table can become extremely slow.

Previously, I was loading the thumbnail directly from my table data source’s cellForRowAtIndexPath: method.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"tvCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"tvCell" owner:self options:nil];
        cell = tvCell;
        self.tvCell = nil;
    }
    NSString *url = [picUrls objectAtIndex: indexPath.row];
    UIImageView *img = (UIImageView*)[cell viewWithTag: 2];
    img.image = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString: url]]];
}

If you don’t have too many rows, a NSMutableDictionary makes a quick & easy image cache. I simply added one method to implement image caching:

NSMutableDictonary *imageCache;

- (UIImage *)getCachedImage: (NSString*)url
{
    UIImage* theImage = [imageCache objectForKey:url];
    if ((nil != theImage) && [theImage isKindOfClass:[UIImage class]]) {
        return theImage;
    }
    else {
        theImage = [UIImage imageWithData: [NSData dataWithContentsOfURL:[NSURL URLWithString: url]]];
        [imageCache setObject:theImage forKey:url];
        return theImage;
    }
}

When I load my table, I now call getCachedImage rather than fetching the image directly.

    img.image = [self getCachedImage: url];

The result can be seen below:

PicSlide 1.6 Submitted

I just submitted the update to PicSlide 1.6. This version adds one new feature: Magic Pandas.

Flickr has Magic Pandas that vomit rainbows and photos. If you ask them nicely, they’ll give you some of the most interesting pictures they can find, which PicSlide will let you play with and even save to your photo album.

This app shouldn't have been approved

Via ipodnn:

Apple has flipped its stance and decided to approve an iPhone app for a Republican Congressional candidate, says the New York Times. The app, created for Ari David, was initially rejected for being defamatory of the incumbent, Democrat Henry Waxman. The app makes many attacks against Waxman, for instance suggesting that he “tried to strangle family farms with insane Soviet-style regulation.”

Whether you support the candidate or not (and I don’t), having an app that’s in effect an attack ad on their opponent is wrong. If the app simply promoted the candidate without attacking & smearing his opponent, it would be fine.

I really hate attack ads. When I see them it only makes me dislike the candidate that made the ad and I’m actually less likely to vote for him. These attack ads are what caused today’s toxic political climate. I don’t want to see the app store filled with more of these personal attack apps.

ICHC App will return soon

Cheezburger Networks finally has an App Store account, and we’re in the process of setting up provisioning so I can resubmit the app. When it returns, it will be listed under Cheezburger Networks and will no longer be sold by me.

UPDATE: It will be listed under Pet Holdings. It’s built with the new app ID & provisioning, and will hopefully be submitted this week (I don’t have the ability to submit apps with their account).

UPDATE #2: It’s still “in progress” with no ETA. They also said:

plz start sending comments to our customer service page if you would

http://cheezburger.com/contact

Upcoming Releases

I have two app updates coming up in the next few days:

  • iDjembe 2.1 becomes Universal and loses the “virtual drumcircle” which I don’t think anyone uses. In the future I will add other recording & sharing options.
  • PicSlide 1.6 gets Magic Pandas.

The artwork for Removr is complete, but we haven’t finished designing all of the levels.

I no longer own I Can Has Cheezburger. When it returns, it will be sold by Cheezburger Networks instead of by me. They’re still in the process of getting their company developer account approved.

 

Cheezburger disappearance

As you may have noticed, I Can Has Cheezburger app is no longer available. I have removed it from sale and it will be re-submitted by Cheezburger network when their app store account is set up. Unfortunately this means updates will no longer be available for anyone who bought the app from me. I’d rather not have people continue to buy it and then feel ripped off when they can’t update.

I will continue to develop the app as a contractor for Cheezburger networks, although I will no longer be selling it myself.