是否可以使用NSClassFromString()创建动态应用程序? [英] is it possible to make a Dynamic application with NSClassFromString()?

查看:66
本文介绍了是否可以使用NSClassFromString()创建动态应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用XML或JSON告诉我的应用程序.我想制作一个动态应用程序,该应用程序将通过从XML传递类来更改功能.

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.

有可能吗? 如果是,请您告诉我如何使用NSClassFromString与XML或JSON解析器进行交互?

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

推荐答案

NSClassFromString()仅返回Class对象.无法序列化类方法并以这种方式解压缩它们.您可以为类定义自己的字符串格式,但不能在运行时添加全新的方法(这违反SDK规则).

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).

这篇关于是否可以使用NSClassFromString()创建动态应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆