Skip to content

{ Author Archives }

Const CGRect in Objective C

File this under something I just learned from one of our vendors; you can declare const structs like a CGRect in your implementation like this: const CGRect kPlaceholderFrame1 = { .origin.x = 126.0f, .origin.y = 22.0f, .size.width = 180.0f, .size.height = 100.0f };

OSX utility to convert a plist to json

Here’s a new utility  for OSX Lion I threw together to convert a plist file to a JSON file. It takes a single argument, which is an absolute or relative path to a plist file. The output of this application will be a JSON file written in the same directory of the plist. Grab the source […]

Creating a PDF with iOS

CreatePDFExample If you find yourself in the position where you need to generate a report that can be printed from your iOS application, you could either integrate directly with the AirPrint APIs, or you can alternatively generate a PDF file so the report can be emailed as well as printed. This is a relatively easy […]

Objective-C Version String Comparison

Often in code you have to compare two version strings, such as and 1.2. You can not just convert these to fractions since there are multiple periods which do not correlate to a decimal number. The best way I found was to use the build in string comparator with some options. Listed below is […]

Drawing polyines or routes on a MKMapView in iOS4 – Part 3

Get right to it: here’s the sample code With the release of iOS 4, Apple has drastically decreased the complexity involved in rendering shapes, including routes, on a map. In fact, they’ve added an entire set of classes to MapKit specifically designed to help you add shapes to a map. These new classes and protocols […]

Which Platform

Had an interesting time tonight at the XConomy Mobile Madness conference. I was invited to be a guest panelist in a forum titled “Mobile Smackdown”; the point of the forum was to debate the merits of various mobile platforms. I was chosen to argue for the iPhone. As far as mobile development platforms are concerned, […]

Come Write Software

Come write software with me and the rest of Raizlabs. We’re looking to build our team of developers. Are you interested in writing mobile applications? Send me a note.

Objective-C SHA1 Function for the iPhone

Here’s a nice little function that will generate an SHA-1 hash digest that will match what the php sha1() function will generate if you give it the same input: #import <CommonCrypto/CommonDigest.h> @implementation SHA1 +(NSString*) digest:(NSString*)input { const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding]; NSData *data = [NSData dataWithBytes:cstr length:input.length]; uint8_t digest[CC_SHA1_DIGEST_LENGTH]; CC_SHA1(data.bytes, data.length, digest); NSMutableString* output […]

Drawing polyines or routes on a MKMapView (as an MKAnnotationView) – Part 2

It turns out there is a better way to display routes on a map than the last example I gave. The problem with my last example is that the route exists in a layer above the map view, resulting in the line of the route being drawn on top of any annotation views. So pins, […]

Tagged , ,

Lumbar Epidural Steroid Injection

Today I had a series injections of anesthetics and steroids in my spine. These are supposed to temporarily relieve my pain over the next two or three weeks. After that, we get to see if I am still in pain, and how bad it is, and that will be the lead determining factor of whether […]