Using class as key in NSDictionary

前端 未结 7 1383
挽巷
挽巷 2020-12-28 14:00

I\'m writing a contextual \"factory\" that will maintain a dictionary of converter/acting objects which inherit from some Converter class. This class has a method:



        
相关标签:
7条回答
  • 2020-12-28 14:51

    -setValue:forKey: is documented to take an NSString as the second parameter. You'll have to use NSStringFromClass() and NSClassFromString() as adaptors.

    0 讨论(0)
提交回复
热议问题