Adapted to Xcode 4.6