Use NSValue method on both iOS and OS X