[self MethodName]和[self performSelector:@selector(Method Name)]之间的区别 [英] Difference between [self MethodName] and [self performSelector:@selector(Method Name)]
本文介绍了[self MethodName]和[self performSelector:@selector(Method Name)]之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用以下类型调用方法有什么区别
What is the difference between calling the methods with following types
1。
[self methodName];
和
2。 >
2.
[self performSelector:@selector(methodName)]; // no afterDelay is used
就像performSelector会使用不同的线程工作
Is it like performSelector will use different thread to work??
推荐答案
在大多数情况下,它们是等效的。
In most cases, they are equivalent.
根据文档中, performSelector:
变体的目的是您可以调用动态定义的,在编译时实际不存在的方法。就这样。对于调用 在编译时出现的方法,两者之间没有区别。
According to the documentation, the purpose of the performSelector:
variant is so that you can call methods that are defined dynamically and not actually present at compile-time. That's all. For calling a method that is present at compile-time, there is no difference between the two.
这篇关于[self MethodName]和[self performSelector:@selector(Method Name)]之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文