Fixed iOS 7 deprecated method bug.