swift - Correct way to pass data between objects through middlemen -
my project has myviewcontroller
children inside of mywindow
, , 1 of children has properties should set through settings located in window. mywindow
quite short:
class mywindow: nswindow { @iboutlet var viewcontroller:myviewcontroller! var win2 = mysettingswindowcontroller(windownibname: "mysettingswindowcontroller") @ibaction func show(sender:anyobject){ win2.showwindow(sender) win2.storage.body_arr = viewcontroller.getsimulationcurrentparameters() } }
i know looks real bad, cannot think of other solution. doesn't work want it, because changes body_arr
should applied simulation parameters inside of object inside of myviewcontroller
(they should same). how should done? seems there 3 objects between storage
, mysimulation
Comments
Post a Comment