I really need some help here. Ever since I started programming with Cocoa I had problems getting my head around multiple view controllers and array controllers. I always got through with some bad glueing code and a bad code structure.
I'm starting a new project and want to get it right this time.
The main question is:
Lets say I have a document based app(!) and its kinda like a master-detail thing. Its with storyboards on 10.10
One view with a table, the other with the info for the entry.
I need some basic structure help here. The info is stored in an array which means I need a NSArrayController somewhere. If I put a Object into IB which stores the mutablearray, I need to put it and the arraycontroller into the same scene of the storyboard. How can I now access anything from within another viewcontroller?
How is this normally done? If I reference the NSArrayController in FirstViewController I have it there but I need to do some work with the data in SecondViewController too and not only displaying it, I need to calculate things with the data. I cant put another NSArrayController in SecondViewController because then I would need to put another Object into the scene too and it would be a new one, not the old one with the data in it.
I dont know if I'm missing something obvious here but I cant get my head around this. I need to access the array of data in multiple places, in multiple ViewControllers and not just in IB, I also need to use the data in code too.
This question evolves to a bigger question but if I can get some help with this idea I might be able to solve it by myself.
Thanks in advance for some basic guidance here.
EDIT Ok after googleing almost the whole day I'm kinda in between thinking no one else knows this because all the other questions similar to mine on here did not get answered or this is just not really possible without doing more work? All I can think of is referencing the ArrayController in windowcontroller and somehow tell the viewControllers to use that data but what sense makes that to use storyboards on osx in the first place?
I think I would have got a better picture of how to do this if Apple actually released the storyboard version of Sketch (sketch "the next generation") like they talked about it in the wwdc video there has do be some ideas in there but yeah. Today I dont think thats possible with storyboards. I will have to continue to do it my way.
-Benjamin