How to pass userInfo in NSNotification?

后端 未结 4 1033
甜味超标
甜味超标 2020-12-23 19:36

I am trying to send some data using NSNotification but get stuck. Here is my code:

// Posting Notification
NSDictionary *orientationData;
if(iFromInterfaceOr         


        
4条回答
  •  难免孤独
    2020-12-23 20:08

    You get an NSNotification object passed to your function. This includes the name, object and user info that you provided to the NSNotificationCenter.

    - (void)orientationChanged:(NSNotification *)notification
    {
        NSDictionary *dict = [notification userInfo];
    }
    

提交回复
热议问题