It’s now been just over 3 weeks since the torrent of information unleashed at Apple’s World Wide Developer Conference refreshingly drenched the brains of designers, developers and engineers. I’ve resisted blogging about the public announcements to fully let the impact soak in and gage everyone’s reactions but now feels like a good time to talk about where the future of computing is heading.
Read the rest of this entry »
Archive for the ‘iPhone’ Category
WWDC Update: 5 key points for iPhone apps
Pub Darts now with Facebook Support
Hey, just to let you know Pub Darts 1.2 is now up in the App Store.
The biggest feature this new version supports is Facebook integration. Yes thats right… you can now log in and pull a “friend’s” profile picture straight onto the dartboard ready to let off some steam. Mmm, now if only you could download and try it out for free… wait you can because I made it free for a short while!
Here’s the link for Pub Darts.
So what else is in this free update?
Well I’ll tell you. This is what some people have been begging me for…
- Ability to refresh dartboard
(You can now remove the tiny dart holes) - Dart sound effects
(Satisfying thuds as a dart hits the board – woop!) - Bug fixes related to using camera and albums
(Needed fixing particularly for large images)
Just in case you can’t find it, to access Facebook navigate to…
Settings > Boss Image > Camera > Grab From Facebook
Let me know what you’d like to see in the next update. Either in the comments or an email. Of course, you could always leave a really positive review if you enjoy it
Core Data Objects in Wrong Sections
NSFetchedResultsController is a really handy class. Use one of the default Core Data templates in Xcode and you’ll very quickly have a nice list of managed objects in a table view. With a few more lines of code you can get the NSFetchedResultsController to group your objects by sections. You do this by specifying a key-path in the class’s constructor method but there is another step that if overlooked will cause some confusion.
In a sample app I’ve created a food table that lists food in categories.
FetchedResultsController method grouping sections using a key-path:
- (NSFetchedResultsController *)fetchedResultsController { if (fetchedResultsController != nil) { return fetchedResultsController; } // Create and configure a fetch request with the food entity. NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"RWFood" inManagedObjectContext:managedObjectContext]; [fetchRequest setEntity:entity]; // Create the sort descriptors array. NSSortDescriptor *nameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:nameDescriptor, nil]; [fetchRequest setSortDescriptors:sortDescriptors]; // Create and initialize the fetch results controller. NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:@"category" cacheName:@"Food"]; self.fetchedResultsController = aFetchedResultsController; fetchedResultsController.delegate = self; // Memory management. [aFetchedResultsController release]; [fetchRequest release]; [nameDescriptor release]; [sortDescriptors release]; return fetchedResultsController; }
Save and quit the app a few times and you’ll see the objects seem to be in the wrong sections. If you look closer you’ll see that the objects are actually sorted in ascending name order. On looking at the code, it seems this is exactly what we asked the program to do! After some testing it also seems to show up more often if the table is a grouped one.
As per the docs, after you specify a key-path to group each section with you also need to make sure the first sort descriptor is sorting this key-path. Add a sort descriptor and everything will work as expected.
Revised fetchedResultsController method with missing sort descriptor:
- (NSFetchedResultsController *)fetchedResultsController { if (fetchedResultsController != nil) { return fetchedResultsController; } // Create and configure a fetch request with the plant entity. NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"RWPlant" inManagedObjectContext:managedObjectContext]; [fetchRequest setEntity:entity]; // Create the sort descriptors array. NSSortDescriptor *typeDescriptor = [[NSSortDescriptor alloc] initWithKey:@"type" ascending:YES]; NSSortDescriptor *nameDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:typeDescriptor, nameDescriptor, nil]; [fetchRequest setSortDescriptors:sortDescriptors]; // Create and initialize the fetch results controller. NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:@"type" cacheName:@"Plants"]; self.fetchedResultsController = aFetchedResultsController; fetchedResultsController.delegate = self; // Memory management. [aFetchedResultsController release]; [fetchRequest release]; [categoryDescriptor release]; [nameDescriptor release]; [sortDescriptors release]; return fetchedResultsController; }
iPhone App: Throw Darts at your Boss
Hooray. My iPhone game, Pub Darts is in the App Store. It’s a slick dartboard game with the added bonus of being able snap your boss/greedy banker and throw darts at their image. Just don’t let them catch you
Buy it now for only £1.19 ($1.99). For a short time only it’s now completely free! Grab it now.


