How to perform Callbacks in Objective-C

后端 未结 5 1351
无人及你
无人及你 2020-11-27 09:09

How to perform call back functions in Objective-C?

I would just like to see some completed examples and I should understand it.

5条回答
  •  醉酒成梦
    2020-11-27 09:25

    CallBack: There are 4 types of callback in Objective C

    1. Selector type : You can see NSTimer,UIPangesture are the examples of Selector callback. Used for very limited execution of code.

    2. Delegate Type : Common and most used in Apple framework. UITableViewDelegate, NSNURLConnectionDelegate. They are usually used to show Downloading many images from server asynchronously etc.

    3. NSNotifications : NotificationCenter is one of features of Objective C which used to notify many receiptants at time when event occur.
    4. Blocks : Blocks are more commonly used in Objective C programming. It is great feature and used for executing chunk of code. You can also refer tutorial to understand : Blocks tutorial

    Please let me if any other answer for it. I will appreciate it.

提交回复
热议问题