Techniques for Shrinking App Size
This Wednesday Apple geeks around the world anxiously await the release of the next generation of iPad. This is widely expected to include a Retina display increasing the resolution of the iPad to a whopping 2048x1536. While I can’t wait to use an iPad with a screen this large, it does present a challenge to developers who want to keep their app bundles below the 20MB limit for 3G download. Here are a few techniques that developers can use to keep their bundles lean.
Problems with stretchableImageWithLeftCapWidth method
I have had the same problem with the stretchableImageWithLeftCapWidth method of UIImage few times already and every time when I get this problem I remember that I have had it already but do not remember how I fixed it. (However for many people it may be obvious from the very first look)
The problem is as follows:
let’s say you have an image (see picture below) which is supposed to be your button’s background:

The code you are going to use for this is:
Everything looks fine but when you start your app the button doesn’t look right at all:

First I thought that the code was incorrect. So I spent some time trying to find out what might be wrong with the code. Then I was trying to find what might be wrong with the image and the project settings. Afterwords when attempts above failed I realised that it’d make sense to check the size of the image and - bingo. The image width was 12 and I set 12 as the left cap width for the image so that’s the reason why the button looked weird. Thus as soon as I changed the cap to 6 the button looked as expected:

MWPhotoBrowser — A simple iOS photo browser
MWPhotoBrowser is an implementation of a photo browser similar to the native Photos app in iOS. It can display one or more images by providing either UIImage objects, file paths to images on the device, or URLs to images online. The photo browser handles the downloading and caching of photos from the web seamlessly. Photos can be zoomed and panned, and optional (customisable) captions can be displayed. Works on iOS 3.2+. All strings are localisable so they can be used in apps that support multiple languages.


