Fix compilation on  Xcode5 / 10.9

These fixes update some deprecations to make the code compatible with Xcode 5 / 10.9. I'm relatively unfamiliar with Objective C and Xcode, but this works for me.