1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Passing variables between views in Tab Bar Controller

Discussion in 'iPhone/iPad Programming' started by dusker, Dec 9, 2009.

  1. macrumors member

    #1
    Hi,

    i'm having a problem with passing variables among ViewControllers in tab bar controller.
    I've built an app using tab bar template. I've created several tabs (each one got viewcotroller and xib linked). UI works ok. BUT one of the views generate an NSMutableArray that needs to be passed over to another view.
    And here's my problem, i don't know how to reference that NSMutableArray that has been generated in that other viewcontroller.
    Could anyone help?

    thanks
    peter
     
  2. macrumors regular

    drf1229

    #2
    What you need is to connect the views with IBOutlets. Once thats done, you need to make the variables you want into properties in the views you want.
     
  3. macrumors 6502

    #3
    Is each view controller a direct subclass of UIViewController, or are there a couple of UINavigationControllers thrown in?
     
  4. macrumors member

    #4
    Thanks for help, i figured it out myself finally.
    Inside a viewcontroller that is managed by tab bar you can reference any other by

    self.tabBarController.viewControllers - it's an array of viewController instances.
     

Share This Page