开发者

invoking a delegate method of a class by code

开发者 https://www.devze.com 2023-03-26 21:14 出处:网络
is it possible to invoke a delegate method of a class by code? In my case I want to invoke the searchBar:textDidChange: m开发者_如何学Pythonethod in my code!

is it possible to invoke a delegate method of a class by code? In my case I want to invoke the searchBar:textDidChange: m开发者_如何学Pythonethod in my code! If yes how would I do that ?


Yes, if you know exactly how to cook the objects for its parameters.

It is just another method and you can call like

[self searchBar:parameter textDidChange:parameter];

IMHO, I would say, in this case, searchBar is in better position to pass the objects, rather than you invoke yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消