iOS: what is the equivalent of an event listener in Objective-C?

ios, ios5, model-view-controller, objective-c

Solution

look into delegates delegates tutorial

or blocks a bit more advanced basic blocks tutorial

just start with delegates,

you can also use NSNotification NSNotification tutorial but is not recommended as it broadcast to every class, and you might only need to send messages to a specific class not every one

Problem

In some of my learning I saw someone mention that in your view controller you can have a model and have some sort of listener on the model for changes in it. I don't think I'm using the right names for these, which is probably why my searches haven't turned up anything. Essentially I want to move my server calls from the controllers into my models, but I need some sort of listener on them to know when the call is complete to update my views.

Original source

Related problems