Using class as key in NSDictionary

前端 未结 7 1439
挽巷
挽巷 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:42

    I was looking for the setObject:forKey: method instead of setValue:forKey:. The method signature for setObject:forKey: accepts (id) as both parameter types, and is much better suited.

提交回复
热议问题