Quick bit of code to throw in your app delegate as a test for any missing retina assets. Useful when checking if you’re all set for the retina iPad:

// Figure out which images don't have an @2x
NSArray* files = [[NSBundle mainBundle]
    pathsForResourcesOfType:@"png" inDirectory:nil];
for (NSString* file in files) {
    if ([file rangeOfString:@"@2x"].length==0) {
        NSString* retina = [file
            stringByReplacingOccurrencesOfString:@".png"
            withString:@"@2x.png"];
        if (![files containsObject:retina]) {
            NSLog(@"Missing retina: %@", [file lastPathComponent]);
        }
    }
}

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.

Chris Hulbert

(Comp Sci, Hons - UTS)

Software Developer (Freelancer / Contractor) in Australia.

I have worked at places such as Google, Cochlear, Assembly Payments, News Corp, Fox Sports, NineMSN, FetchTV, Coles, Woolworths, Trust Bank, and Westpac, among others. If you're looking for help developing an iOS app, drop me a line!

Get in touch:
[email protected]
github.com/chrishulbert
linkedin



 Subscribe via RSS