Group Group Group Group Group Group Group Group Group

Multi-Cast Delegate Pattern – Question

Hi everyone. Awesome book, learning lots! I’m having a go at making an app using the multi-cast delegate pattern. I have a couple of questions though.

Question 1
In the playground example, the delegate object variables are created like this:

In my app, my initial controller is View Controller A. The delegate objects are other View Controllers (B, C, & D). Do I just create the variables in my initial View Controller like this:

ViewControllerA

Question 2
If I type a location in the textField (shown below) & click send, View Controller B, C, & D print out a message to the console to show that the system is working. But, when I navigate to each by clicking the relevant tab bar icon (B, C, or D), the ‘location’ label on each view controller’s screen hasn’t held onto the variable at all.

I would have thought that the value would have persisted, at least until the screen was visited, but it seems as though the value is not held in memory at all? Is this normal?

I wonder if I have to actually manually persist the location value (String) for each View Controller so that it can be recalled when navigating to each particular screen? Thoughts??

Thanks!! :relaxed:

@jrg.developer Can you please help with this when you get a chance? Thank you - much appreciated! :]