title: Objective C: open and close a subview
body: <p>This is my code with two IBAction for open and close a subview in two different classes</p>
  
  <pre><code>- (IBAction) showListClient:(id) sender {
  
  if( list == nil){
  
      list = [[ListClient alloc] initWithNibName:@"ListClient" bundle:nil];
      [list setDelegate:self];
      [self.view addSubview:list.view];
  }
  
  }
  </code></pre>
  
  <p>and for close</p>
  
  <pre><code>-(IBAction)closeListClient {
  [self.view removeFromSuperview];
  }
  </code></pre>
  
  <p>now it's ok for the first time, but if I want use more time my list I must write in closeListClient</p>
  
  <pre><code>list = nil;
  [list release];
  </code></pre>
  
  <p>now my problem is this "list" is declared only in the class ListClient as</p>
  
  <pre><code>ListClient *list;
  </code></pre>
  
  <p>and when I write list in CloseListClient is an error...what can I do?</p>