Edited to compile using Xcode 6.1.