title: How to move custom view to different superview after it was displayed by UIBarButtonItem?
body: <p>This is the original layout: A <code>UIBarButtonItem</code> displays a custom view inside a <code>UIToolbar</code>:</p>
  
  <pre><code>+-- main view --------------+
  |                           |
  |                           |
  | +-- toolbar ------------+ |
  | | +-- custom view ----+ | |
  | | |                   | | |
  | | +-------------------+ | |
  | +-----------------------+ |
  +---------------------------+
  </code></pre>
  
  <p>Here is how I am doing this:</p>
  
  <pre><code>UIBarButtonItem* button = [[[UIBarButtonItem alloc] initWithCustomView:self.customView] autorelease];
  NSArray* items =  [NSArray arrayWithObject:button];
  self.toolbar.items = items;
  </code></pre>
  
  <p>After some user interaction I want to remove the custom view from the toolbar and display it somewhere else, in this example directly as a subview of the main view:</p>
  
  <pre><code>+-- main view --------------+
  |                           |
  | +-- custom view ----+     |
  | |                   |     |
  | +-------------------+     |
  |                           |
  | +-- toolbar ------------+ |
  | |                       | |
  | +-----------------------+ |
  +---------------------------+
  </code></pre>
  
  <p>I am trying to do this like so (<code>self</code> is a view controller):</p>
  
  <pre><code>self.toolbar.items = [NSArray array];
  CGRect frame = self.customView.frame;
  frame.origin.x = 10;
  frame.origin.y = 10;
  self.customView.frame = frame;
  [self.view addSubview:self.customView];
  </code></pre>
  
  <p>This does not work. For some reason the custom view is not displayed after I move it to its new superview. I must be doing something wrong here, but I don't know what it is. Any hints?</p>