is it possible to make a Dynamic application with NSClassFromString()?

一笑奈何 提交于 2019-12-12 04:24:51

问题


I want to use XML or JSON to told my app. I want to make a dynamic application that will change a feature by passing class from XML.

is it possible ? if YES, could you please show me how to use NSClassFromString to interface with XML or JSON parser?


回答1:


NSClassFromString() only returns a Class object. It's not possible to serialize a classes methods and unpack them in this way. You could define your own string format for classes but you can't add completely new methods at runtime (it's against the SDK rules).



来源:https://stackoverflow.com/questions/2467291/is-it-possible-to-make-a-dynamic-application-with-nsclassfromstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!