NSClassFromString returns nil

后端 未结 7 1564
礼貌的吻别
礼貌的吻别 2020-12-09 04:28

Why does NSClassFromString return nil ? As per the definition it has to return class name. How should I take care to rectify this problem? I need t

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 05:11

    I also saw an oddity where adding the standard singleton code espoused by apple prevented the class from being loaded. The code was working as expected, then I added the singleton, and suddenly the NSClassFromString started returning nil. Commenting out the singleton code resulted in the NSClassFromString resolving the class correctly. I don't understand the interaction, but I think the singleton static var was somehow getting mangled to hide the class name...?

提交回复
热议问题