Fix deprecation warnings for iOS 6.0+

Used iOS version preprocessor macros to remove deprecations when building for iOS 6.0+.