Add conditions to fix compilers warnings under iOS 6 sdk