title: rightbarbuttonitem not displaying
body: <p>I have got following code for putting rightbarbuttonitem</p>
  
  <pre><code>UIButton* rightbutton = [UIButton buttonWithType:UIButtonTypeCustom];
      [rightbutton setBackgroundImage:[UIImage imageNamed:@"share-icon.png"] forState:UIControlStateNormal];
      [rightbutton addTarget:self action:@selector(share:) forControlEvents:UIControlEventTouchUpInside];
      self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:rightbutton] autorelease];
  </code></pre>
  
  <p>But it is not displaying any barbuttonitem. Instead if I use following code then barbutton item appears but problem is i cant set touch event with this code on barbuttonitem.</p>
  
  <pre><code>UIImageView *iconView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dashboard-icon.png"]];
      UIBarButtonItem *icon = [[UIBarButtonItem alloc] initWithCustomView:iconView];
      self.navigationItem.leftBarButtonItem=icon;
      [icon release];
      [iconView release];
  </code></pre>