Updated the deprecated code in iOS7.