xcode - How to pass value from NSTabViewController to child view? -


I have to be a tab menu in my Mac desktop application, each tab will show programmers (content loading from the internet) and Then load information. I want to use ViewController to be loaded on every page and only this data should pass what data should be downloaded (according to the selected tab user). How can I get information from the ViewController from NSTabViewController? This is how my storyboard looks:

storyboard

< storyboard "document Profile" panel (usable on the coincidence degree which lists the scene, objects, etc.), under the tab view controller, there

Two objects will be labeled "tab view item", give each one of them an identifier. (In the example below, they are "entriesTabItem" and "contactTabItem".)

Then, TabViewController subclass, and in the sub-category, add something like the following in the "viewDidLoad":

  override func viewDidLoad () {var.vidiDidLoad ()} var entryIndex = self.tabView.indexOfTabViewItemWithIdentifier ("entriesTabItem") EntityVitim: NSTabViewItem = self.tabViewItems [entryIndex] as NSTabViewItem var entries: EntryViewController? = EntryViewController as entries TVItem.viewController? If (entry! = Zero) {entriesVC! .topTabView = self.tabView entriesVC! .topTabVC = self} var contactIndex = self.tabView.indexOfTabViewItemWithIdentifier ( "contactsTabItem") var contactTVItem: NSTabViewItem = self.tabViewItems [contactIndex] as NSTabViewItem var contactVC: ContactViewController? As Contact IViewControllerContentViewController? If (contactVC! = Zero) {contactVC! .topTabView = self.tabView contactVC! .topTabVC = self}}  

The above code, the scene controller can individually instead of the same class, and you can do what you want variables.

I was last week, and he drove me crazy!


Comments