I created a program to send and receive events through NSNotification. Now i need to send data along with the event. Can anyone suggest me how to do this in coding in Objective-C??
I created a program to send and receive events through NSNotification. Now i need
Share
There are two ways – one, you can pass any one object in with a notification – look at
The second thing is, you can also pass an optional dictionary with as many objects as you like in it, you just need to have both sides agree on the keys used to store and retrieve the objects. That call is:
You can always pass a nil for either anObject or userInfo in either call.
An example call that sends a notification directly (you don’t have to construct the notification first if you do not want to):
There’s also a variant of that call with userInfo added on, just as there is for notification construction.