Updated for Xcode6