title: How to cast an object in Objective-C
body: <p>Is there a way to cast objects in objective-c much like the way objects are cast in VB.NET?</p>
  
  <p>For example, I am trying to do the following:</p>
  
  <pre><code>// create the view controller for the selected item
  FieldEditViewController *myEditController;
  switch (selectedItemTypeID) {
      case 3:
          myEditController = [[SelectionListViewController alloc] init];
          myEditController.list = listOfItems;
          break;
      case 4:
          // set myEditController to a diff view controller
          break;
  }
  
  // load the view
  [self.navigationController pushViewController:myEditController animated:YES];
  [myEditController release]; 
  </code></pre>
  
  <p>However I am getting a compiler error since the 'list' property exists in the SelectionListViewController class but not on the FieldEditViewController even though SelectionListViewController inherits from FieldEditViewController.</p>
  
  <p>This makes sense, but is there a way to cast myEditController to a SelectionListViewController so I can access the 'list' property?</p>
  
  <p>For example in VB.NET I would do:</p>
  
  <pre><code>CType(myEditController, SelectionListViewController).list = listOfItems
  </code></pre>
  
  <p>Thanks for the help!</p>