I'm new in objective-c. I try to send data between 2 view controllers (for example controllerA and controllerB), but I need this data constantly, so I use _displaylink in controllerB to call method from controllerA. I use player in controllerA and I want to display time etc. in controllerB. How to get existing instance of controllerA?
I try 2 different ways to do this, but both create new instance of viewcontroller
RootViewController *controller=(RootViewController *)self.presentedViewController;
RootViewController *rootController =(RootViewController*)[[(AppDelegate*)
[[UIApplication sharedApplication]delegate] window] rootViewController];
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MMDrawerController
playerPositionS]: unrecognized selector sent to instance 0x7c406c00'
In MVC as implemented in iOS/Objective-C, view controllers refer to a shared model, not to to each other. They should observe changes in that model, and then update their UIs accordingly.
A few ways to observe changes: