Remove compiler warnings when target is iOS 7 (still compatible with iOS 5) and use non-deprecated API.