在Objective-C中是否可以查看int值是否在特定的枚举中?例如,在这个枚举中:
enum { ValidationLoginFailed = 2000,ValidationSessionTokenExpired = 2001,ValidationSessionTokenInvalid = 2002,ValidationEmailNotFound = 2003 }; typedef int ValidationStatusCodes;
是否可以查看ValidationStatusCodes枚举中是否有任意整数值?
[ValidationStatusCodes contains:intResponseCode]
或至少
[self intIsInRangeofEnum:ValidationStatusCodes forValue:intResponseCode]