enumと文字列を、enum -> NSString、 NSString -> enumと相互にキャストする汎用な方法を調べたときのメモです。 1. NSArrayのExtensionとしてキャストするメソッドを用意します。 // // NSArray+EnumExtensions.h // #import <Foundation/Foundation.h> @interface NSArray (EnumExtensions) /** * enum to string * @param value enum value * @return NSString string value */ - (NSString *)stringFromEnum:(NSInteger)value; /** * string to enum * @param value string value * @re