joelparsons.net

iOS Developer Stuff Every Monday

Debugging Like a Gentleman

I was listening to an episode of the excellent podcast “Edge Cases” by Andrew Pontious and Wolf Rentzsch titled “Primal Debugging Systems” and they basically said that for all the debugging systems we have these days sometims they will just use NSLog statements to debug (Like an animal) because it was easier than getting information out of lldb. While sometimes an NSLog can be enlightening I have a few quick tips that can have you using lldb like a pro in very little time at all.

The Queue Observer Pattern

I’ve been using the “new” block based NSNotificationCenter addObserver methods for a long time now but I’ve come across some projects that use the old target action style notifiction listening so I thought I would post about why I believe this newer method is better.

Background Core Data With privateQueueContext

Working with core data on multiple threads can be challenging, as can working across multiple threads in general, but the privateQueueContext method hasn’t been as talked about as some of the other methods.

privateQueueContext

The old model with NSManagedObjectContext was that you had to create a context on every thread you were going to access core data on. When this context was saved it would write back to the persistent store and notifications would fire that would allow you to update your other contexts on other threads.

Code Runner

Code runner (also available in the Mac App Store) is a fantastic app that should be in every iOS and Mac developer’s toolkit.

If you are ever in the middle of a project and want to write a quick snippet to determine if an API is going to respond the way you think it will then Code Runner can help you out. Quite simply it sets up an environment where you can just start typing in your language of choice and, when you’re ready to test, has a giant play button similar to Xcode that will run your code.

The Boggle Board Question

So I was looking into the “Boggle Board” question which is posted on several programming interview sites. The question is pretty straight forward even if you dont know the game “boggle” which it is based on. You have a nxm matrix of letters and the aim of the game is to make words from those letters. From any arbitraty starting letter you are allowed to travel from letter to letter in any direction including diagonals with the restriction that you cant use the same letter twice.