Use NSFoundationVersionNumber

NSFoundationVersionNumber can be used to check the version of iOS, so when later versions of iOS 8 are released the detection will still work.
Fixed AnyObject array for Xcode 6 beta 4
Merge the branch
Before merge