I’ve got a standard UITableViewCell where I’m using the text and image properties to display a favicon.ico and a label. For the most part, this works really well since UIImage supports the ICO format. However, some sites (like Amazon.com say) have favicon.icos that make use of the ICO format’s ability to store multiple sizes in the same file. Amazon stores four different sizes, all the way up to 48×48.
This results in most images being 16×16 except for a few that come in at 32×32 or 48×48 and make everything look terrible. I have searched here, the official forum, the documentation, and elsewhere without success. I have tried everything that I could think of to constrain the image size. The only thing that worked was an undocumented method, which I’m not about to use. This is my first app and my first experience with Cocoa (came from C#).
In case I wasn’t clear in what I’m looking for, ideally the advice would center around setting the dimensions of the UIImage so that the 48×48 version would scale down to 16×16 or a method to tell UIImage to use the 16×16 version present in the ICO file. I don’t necessarily need code: just a suggestion of an approach would do me fine.
Does anyone have any suggestions? (I asked in the official forum as well because I’ve sunk more than a day into this already. If a solution is posted there, I’ll put it here as well.)
Here’s what user “bcd” over at the official forums posted that ended up solving the problem (with a slight modification by myself to make it static for inclusion into a set of utility methods):