Text

Easier Simple Sorting of an NSArray

Instead of this…

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"theKey" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *sortedArray = [theArray sortedArrayUsingDescriptors:sortDescriptors];

…add this as a category on NSArray

- (NSArray *)sortedWithKey:(NSString *)theKey ascending:(BOOL)ascending {
    return [self sortedArrayUsingDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:theKey ascending:ascending] autorelease]]];
}

…and call it like so:

NSArray *sortedArray = [theArray sortedWithKey:@"theKey" ascending:YES];

Obviously only works for a single sort.

Text

On The iPad: Addendum

I’m not arguing for one second that the iPad will lower the bar of entry to any profession, all I’m saying is that by abstracting away as much of the cruft as possible in a user interface, you ensure that people are spending their time doing what they actually need to do, rather than learning the intricacies of yet another inaccessible software package - skills that, and the end of the day, are orthogonal to what they are actually trying to achieve - and by doing that, you are in fact lowering the bar of entry to computing itself.

Think of the iPad as Apple’s Wii.

Text

On The iPad

Originally a reply to this post questioning my thoughts on reposting Fraser Speirs’s Future Shock entry:

You know, normally i would agree with his outlook on this situation. That is for most other products. In this case i have to disagree with one key point to the topic. That is that the Ipad is a step forward in technology. It isn’t. It’s just repackaged options that we have had for over a decade, now bundled into a second iteration of a product that we already have. The fact that the tech specs speak more for it’s limitations than it does it’s potential speak volumes too me. Even with the slant on future gaming ( I’m an avid gamer, so i paid quite a bit of attention to this next step) they really didn’t advance a single step forward. Bigger doesn’t equate to better when it’s not exponential. And for what extremely little that it does offer, the price point is simply retarded for a hamstrung product. With that said, I’ll bet dollars to piss that it’s going to sell like crazy. People are just sheep when it comes to pseudo gadgets. In this case, the “infantilising effect of high technology on adults” is actually prudence.

I’d argue that it is a step forward, when you consider it as the first generation of the line. Yes in some ways it’s repackaged tech, but think of all the Apple innovations (that they may not have invented, but did make ubiquitous in a mobile device) that have gone into it - multitouch, accelerometer, obfuscation of the file/folder paradigm, unibodies, custom shaped batteries with improved usage times, custom silicon built in-house for a specific device - and how they’ve been building to this, little by little, for the last five years.

I can’t help but think two things:

  1. If Microsoft/HP/Dell had unveiled the same product, everyone would’ve shit their pants at how great they thought it was and how incredible the price point was.

  2. The iPhone was a necessary step before the iPad could be unveiled. As Jobs said, there are 75m people who will instantly know how to interact with the iPad, and can probably mentally abstract a lot of how it works when they’re using their iPhone/iPod Touch. If the devices had been released in the reverse order, I think the public would have a harder time grasping some of the principles behind the iPad.

  3. (I lied) The biggest thing for me with the iPad is something I vaguely remember either Jobs or possibly Bertrand Serlet talking about a few years back in a keynote - the traditional desktop metaphor, which was fine even 10 years ago but doesn’t scale well at all has finally been hidden from the user in a logical way. Data is available in whichever app you created it. Write something in Pages and want to open it? Tap Pages and it’s there. No trawling through a mountain of metaphors just to find the right damn document. Trust me when I say in my line of work this is a BIG thing.

  4. (Sorry) Where Fraser absolutely nails it in my opinion is here:

The Real Work is not formatting the margins, installing the printer driver, uploading the document, finishing the PowerPoint slides, running the software update or reinstalling the OS.

The Real Work is teaching the child, healing the patient, selling the house, logging the road defects, fixing the car at the roadside, capturing the table’s order, designing the house and organising the party.

Think of the millions of hours of human effort spent on preventing and recovering from the problems caused by completely open computer systems. Think of the lengths that people have gone to in order to acquire skills that are orthogonal to their core interests and their job, just so they can get their job done.

If the iPad and its successor devices free these people to focus on what they do best, it will dramatically change people’s perceptions of computing from something to fear to something to engage enthusiastically with.

The best software is software that lets you easily do what you want, is intuitive, and stays the hell out of the way.

(Imlookingatyouyoustupidgoddamnfuckingpaperclip).

As a developer, working with the iPhone has changed how I think (and benefitted my work on other platforms) and has changed how a hell of a lot of devs think about their code, their designs and their products. If that focus and ease of use can be transferred from the iPhone to the iPad, I’m 100% squarely behind it.

I’m personally tentatively excited, both as a developer and a user, but I’ll reserve final judgement until I can actually play with the damn thing.

Finally, I’ll hazard a guess you are not the sole computer-literate individual in your place of employment, otherwise you might be bouncing off the walls at the prospect of no longer having to explain desktop metaphors and file/folder abstractions.

Text

Core Data Migration and Versioning

Yep, another Core Data post. Hat tip to Jeff LaMarche for the solution on this one.

After adding a new data model version, then moving some furniture around and adding a few new bits and bobs, I hit Build & Go and was hit with the fantastically detailed error:

Can't merge models with two different entities named 'SuckItBiatch'

Head on over to Jeff’s post for the full explanation of what’s going on here but to cut a long story short, there’s an issue with how the .momd bundle works in tandem with Apple’s template code.

Replace the standard -managedObjectModel method with the following, and as long as all other prerequisite pieces are in order you should be fine.

- (NSManagedObjectModel *)managedObjectModel {
    
    if (managedObjectModel != nil) {
        return managedObjectModel;
    }
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"YourAppName" ofType:@"momd"];
    NSURL *momURL = [NSURL fileURLWithPath:path];
    managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL];
       
    return managedObjectModel;
}
Text

App Store Porn

To all those people bitching - in the wake of ForChan’s removal from the App Store on the basis that it can be used to view pornographic images - that Apple should delete Safari from the iPhone too for the same reason, I ask this question:

Ever actually tried to look at a porn site in MobileSafari? If you can find a non-Flash bosom you’re a better man than me.