如何在没有实例化对象的情况下调用方法(How to call a method without an instantiated object)
这是一个客观问题。
我想在对象中调用一个方法,但是没有对象的实例化。 这可能吗?
我想调用的方法不是类方法。
This is an objective-c question.
I would like to call a method in an object, but there is no instantiation of the object. Is this possible?
The method I want to call is not a class method.
最满意答案
也许你只想要一个普通的C函数。 如果您不想要类方法,并且不需要实例方法,那么这似乎是您唯一的选择。 不要害怕在Objective-C中使用C函数。 每种技术都有它的位置。
Perhaps you just want a plain-old C function. If you don't want a class method, and you don't want an instance method, that appears to be your only option. Don't be afraid of using C functions in Objective-C. Every technique has its place.
更多推荐
发布评论