Author Archives: Ben Collier

If there’s Hellmann’s in the basket, there’s a recipe on the receipt

Great little mar­ket­ing idea, whenever a cus­tomer buys Hellmann’s may­on­naise the other items in their bas­ket are ana­lysed and a recipe prin­ted on the receipt! Should be con­sidered a suc­cess — sales increased by 44%!

iOS SHA512 Hex String

Here’s an Objective C method that’ll return a SHA512 hex of a given string:   -(NSString*) sha512:(NSString*)input { const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithBytes:cstr length:input.length];   uint8_t digest[CC_SHA512_DIGEST_LENGTH];   CC_SHA512(data.bytes, data.length, digest);   NSMutableString* out­put = [NSMutableString stringWithCapacity:CC_SHA512_DIGEST_LENGTH * 2];   for(int i = 0; i < CC_SHA512_DIGEST_LENGTH; i++) [out­put appendFormat:@”%02x”, digest[i]];   […]

App Store Keyword Searching Tips

From the iTunes Connect FAQ: [Developer login required] “Your app is search­able by your app name, your keywords and your com­pany name.” This means you don’t have to waste valu­able keywords by includ­ing your app or com­pany name in the 100 byte keyword limit. To gain a few more char­ac­ters you can also remove the spaces in-between keywords and […]

HTML5 Boilerplate Build Script: no manifest.appcache generated!

The HTML5 Boilerplate build script can auto gen­er­ate your manifest.appcache file but it doesn’t out of the box. Slightly hid­den away in the docs: To enable the appcache, just uncom­ment the file.manifest line in the project.properties file. It’ll cre­ate a manifest.appcache file and wire it all up. You’ll find the project.properties file in build/project. Now just do ant […]

Xcode 4.2 Doesn’t Show Exception Stack Trace in Console

When using Xcode 4.2 for iOS devel­op­ment there’s an annoy­ing bug where any excep­tions crash to the main.m file instead of high­light­ing the line. Luckily you can set a cus­tom break­point to restore the old and cor­rect beha­viour: Open the Breakpoint nav­ig­ator (CMD + 6) Click the + but­ton in the bot­tom left Select Add Exception Breakpoint  Click […]

Status Barred: iOS Screenshot Status Bar Remover App

So many iOS apps developers for­get to remove the screen­shots from their apps on the App Store; often reveal­ing the hor­rendous times the screen­shots were taken and detract­ing from the actual app. iTunes Connect recom­mends the removal of the status bar, and Status Barred removes the status bar per­fectly regard­less of the screen­shot being retina, […]

iOS: Show Users the Reason You Require Their Location

A great, but under­used loc­a­tion fea­ture on iOS is the pur­pose prop­erty of the CLLocationManager. So many apps ask for your loc­a­tion — give your users con­fid­ence in shar­ing their loc­a­tion by telling them why you need it! Example:   locationManager.purpose = @“We’ll only use your loc­a­tion to show you local events nearby.”;   You need to do […]

Using Boolean Values with TouchJSON

When cre­at­ing an NSDictionary to seri­al­ize as JSON with TouchJSON you can’t set a BOOL value in the dic­tion­ary because it requires an object. Use an NSNumber, which will be con­ver­ted to true or false by the TouchJSON lib­rary. Eg:   NSMutableDictionary *dic­tion­ary = [[NSMutableDictionary alloc] init]; [dic­tion­ary setObject:[NSNumber numberWithBool:YES forKey:@“shouldBeOn”]; [dic­tion­ary setObject:[NSNumber numberWithBool:NO forKey:@“shouldBeOff”]; NSError […]