Reputation: 31
I have written a class that handles communication over a network and I want a method in the ViewController class to watch certain variables in the communication class and update label text when data from the network is received. I tried calling a method at the end of the ViewDidLoad method after making the calls to establish the network communication but that attempt stopped the view from displaying, and monitoring the network I never saw a connection established.
What is the best way for a method in a ViewController class to watch for updates to public member variables in my communicator class?
Upvotes: 1
Views: 535
Reputation: 8170
You have many options
Upvotes: 3
Reputation: 114865
You can also use NSNotificationCenter to advertise changes to other objects in your application
Upvotes: 0
Reputation: 778
The best way is to make your view controller to be a delegate for communicator instance.
Upvotes: 0