Fixed a incompatible function for ios6.