Passing methods/functions as args in Objective C
Posted
by Baishampayan Ghose
on Stack Overflow
See other posts from Stack Overflow
or by Baishampayan Ghose
Published on 2010-03-29T07:29:17Z
Indexed on
2010/03/29
7:33 UTC
Read the original article
Hit count: 406
Hello, I am new to Objective C and I am trying to implement an async library which works with callbacks. I need to figure out a way to pass callback methods as args to my async methods so that the callback can be invoked when the task is finished.
What is the best way to achieve this in Objective C? In Python, for example I could easily pass a function, but in Objective C it seems selectors are the way to go(?).
Can anyone point me to an example from where I can get some ideas?
Thanks in advance.
© Stack Overflow or respective owner