如何在没有实例化对象的情况下调用方法(How to call a method without an instantiated object)

编程入门 行业动态 更新时间:2024-10-26 18:22:53
如何在没有实例化对象的情况下调用方法(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.

更多推荐

本文发布于:2023-07-05 15:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1039124.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实例   情况下   对象   方法   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!