Questions tagged «swizzling»

8
Objective-C中方法混乱的危险是什么?
我听说人们说方法混乱是一种危险的做法。甚至连起草的名字都暗示这有点作弊。 方法Swizzling正在修改映射,以便调用选择器A实际上将调用实现B。此方法的一种用法是扩展封闭源类的行为。 我们是否可以将风险正式化,以便任何决定是否使用毛毛雨的人都可以做出明智的决定,以决定这样做是否值得。 例如 命名冲突:如果该类以后扩展其功能以包括您添加的方法名称,则将引起大量问题。通过合理命名混淆方法来降低风险。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.