I want to call a method on an object which I get through [self delegate]. I know which class it is so I can import the class and call it normally but I could also use performSelector: which doesn’t require importing my class. I do not need to pass a parameter to the method. And yes, I did read this. Which one is preferable in this case?
I want to call a method on an object which I get through [self
Share
Calling the method directly is more readable.
performSelector:should be reserved for when you need higher order messaging.Strictly speaking, you don’t need to import the class to send it a message as message dispatch is dynamic rather than static, though you will get compile time warnings that the object may not respond to the selector.