Objective C delegate or C-style block callback?

前端 未结 3 1402
花落未央
花落未央 2021-02-09 02:46

I am designing a class that will \"fire events\" whenever something occurs. These events tend to be non-UI related. I\'m wondering what the best method for doing so is. I\'ve be

3条回答
  •  旧巷少年郎
    2021-02-09 03:12

    For your use case NSNotification seems to be the best choice. Objects that need those events then can register for those notifications.

提交回复
热议问题