johan
johan

Reputation: 6666

NSNotification if data changes

Let's assume that I have a program that parses a RSS feed.

I have a method that runs in a thread which keeps checking for updates. If updates is found a NSNotification is created. Is this a stupid implementation?

And is it possible to pass custom parameters within a NSNotification, such as the elementId that was updated.

Upvotes: 1

Views: 325

Answers (1)

Graham Perks
Graham Perks

Reputation: 23398

Sounds like a good plan to me. Yes, you can pass user data.

See NSNotification's notificationWithName:object:userInfo:. The userInfo is an NSDictionary so you can pass whatever you like around.

Upvotes: 3

Related Questions