What is parameter `object` in NSNotification addObserver:?

前端 未结 3 1576
温柔的废话
温柔的废话 2020-12-29 22:31

One of my class named Message.m is posting a notification with an object sentObject as below

NSDictionary *sentObject = [NSDictionary dictionary         


        
3条回答
  •  攒了一身酷
    2020-12-29 22:56

    For anyone interested in apple's documentation. This is what it says:

    notificationSender

    The object whose notifications the observer wants to receive; that is, only notifications sent by this sender are delivered to the observer. If you pass nil, the notification center doesn’t use a notification’s sender to decide whether to deliver it to the observer.

提交回复
热议问题