Use correct NSNumber method for incoming type.