So I have a PanelController which is a NSWindowController, and it instantiates an object called FileUploader. But inside of FileUploader, I want to be able to update some text on the Panel informing the user of the progress that has been made so far. But I don’t know how to reference PanelController given that I can’t instantiate a new one.
Am I supposed to use ApplicationDelegate as the go-between, and if so how do I reference that? If so, do I need ApplicationDelegate to instantiate both PanelController and FileUploader, but then I still don’t understand how to reference the ApplicationDelegate.
Also consider using blocks which is another more modern apple approach to callbacks. Apple is using it more and more in their new APIs.
Here’s a specific SO on updating UI and also making it async:
GCD, Threads, Program Flow and UI Updating
Here’s another SO article on blocks & delegates as callbacks
How to simplify callback logic with a Block?