Tag Archives: iOS

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]];   […]

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 […]

Xcode Install Requires iTunes to be Closed

When installing or updat­ing Xcode you need to close iTunes for it to com­plete. If you’ve closed iTunes but still get this mes­sage: Open Activity Monitor and quit iTunes Helper. The install­a­tion will now fin­ish. This mainly seems to hap­pen on beta ver­sions of iTunes. The helper app runs to detect iOS devices being connected […]

iOS: shouldAutorotateToInterfaceOrientation / Lock Orientation in PhoneGap

Starting in PhoneGap 0.9.5 there’s an undoc­u­mented iOS only fea­ture that allows you to handle whether the device should rotate to a par­tic­u­lar ori­ent­a­tion. It exposes the iOS Objective-C method shouldAutoro­tat­eToInt­er­face­Ori­ent­a­tion with a JavaScript func­tion shouldRo­tat­eToOri­ent­a­tion.   func­tion shouldRo­tat­eToOri­ent­a­tion (rota­tion) { switch (rota­tion) { //Portrait or PortraitUpsideDown case 0: case 180: return true; //LandscapeRight or LandscapeLeft case […]

Things That Give Me Usability Cramps — Web Forms

Usability Cramps [yoo-zuh-bill-ity kramps] n. are unpleas­ant, often pain­ful sen­sa­tions caused by unbear­able unus­able user exper­i­ence mis­takes v. usab­il­ity cramp­ing, usab­il­ity cramped, why the hell did they do this? Form Labels That Don’t Select the Fields This one mega-stresses me out; when the text label next to check­box or a label doesn’t select it when you click it: […]

Xcode iPhone / iPad Apps Screenshot Location

If you’re try­ing to find your iOS app screen­shots you’ve snapped in Xcode dur­ing your app devel­op­ment they’re loc­ated here: ~/Library/Application Support/Developer/Shared/Xcode/Screenshots Enjoy all your lovely iPad and iPhone app sn-apps..