title: How do I pass variables between view controllers?
body: <p>i'm having a hard time with Xcode; for some reason, it just won't let me pass a variable from one view controller class to another. It should work, i was basically just copying/pasting from my other classes (it works on all of them... except this one). I've been at it all night long, tried everything i could think of and still it remains.</p>
  
  <p>Here's the view controller class where I'm making the call:</p>
  
  <h2>ResultadosViewController.h:</h2>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "Filme.h"
  #import "Festival.h"
  #import "Top10Discos.h"
  #import "Peca.h"
  
  @class DetalhesViewController;
  
  @interface ResultadosViewController : UIViewController
  {
      // Navegation
      DetalhesViewController *dvc;
      BOOL isViewPushed;
  
      // What i'd really like to pass lol
      NSArray *array_resultados;
  
  }
  
  @property (nonatomic, retain) NSArray *array_resultados;
  @property (nonatomic, readwrite) BOOL isViewPushed;
  
  @end*
  </code></pre>
  
  <h2>ResultadosViewController.m:</h2>
  
  <pre><code>#import "ResultadosViewController.h"
  #import "DetalhesViewController.h"
  #import "Filme.h"
  #import "Peca.h"
  #import "Top10Discos.h"
  #import "Festival.h"
  
  @implementation ResultadosViewController
  @synthesize isViewPushed, array_resultados;
  
  (...)
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
      // Navigation logic -- create and push a new view controller
  
      if (indexPath.row == 2)
      {
          if(dvc != nil)
              [dvc dealloc];
  
          NSString *ffs = [[array_resultados objectAtIndex:indexPath.row] TituloFilme];
  
          dvc = [[DetalhesViewController alloc] initWithNibName:@"DetailedView" bundle:[NSBundle mainBundle]];
  
          **resultadosControllerCell.array_resultados  = [self array_resultados];** 
          *"Request for member 'array_resultados' in something not a structure or union"*
  
          //Push the view controller to the top of the stack.
          [self.navigationController pushViewController:dvc animated:YES];
  
      }
  }
  </code></pre>
  
  <p>And here's the other class i want to send the array into:</p>
  
  <h2>DetalhesViewController.h:</h2>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  #import "Filme.h"
  #import "Festival.h"
  #import "Top10Discos.h"
  #import "Peca.h"
  
  
  @interface DetalhesViewController : UIViewController
  {
      // Navegacao
      NSArray *array_resultados;
  
  }
  
  @property (nonatomic, retain) NSArray *array_resultados;
  @end
  </code></pre>
  
  <p>I'm not sure if any of you would to see the .m file for this class; in that case, just ask.</p>
  
  <p>Thanks in advance,
  Hal</p>
  
  <p>PS: tried with other variables (other types too), cleansed/rebuilt, recreated xib file, you name it... i'm outta tricks :(</p>