Fixed use of iOS 6 deprecated methods