I get an error when I use objectForKeyedSubscript:
as a class level method, so in my class "MyExample.h/.m" I have something like the following:
+ (id)objectForKeyedSubscript:(NSString*)key;
and I want to do MyExample[@"key"]
, I initialize a static dictionary in a class method.
Are objectForKeyedSubscript:
and the brackets meant to only be used with objects? Is there an alternative way to do it on a class level?