Understanding @Protocols in Objective-C

前端 未结 5 1050
一整个雨季
一整个雨季 2020-12-11 12:38

I am a beginner to programming, and a beginner to Objective-C. I learned basic C and decided to start learning Objective-C. I am reading \"Programming in Objective C 2.0\" b

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 13:19

    Protocols are better versions of callback functions in C. Protocols are useful constructs when you want to implement MVC architecture yourself. The Views need to be notified when Model changes,You can use protocols to notify appropriate events to Observers.

提交回复
热议问题