title: I want to hide button Objective-C ios?
body: <p>When I define the button on <code>.h</code>, it works but when I code the button does not work.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIImage *buttonImage = [UIImage imageNamed:@"nl.png"];
  
      //create the button and assign the image
      UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
      button.frame=CGRectMake(230,302,32,32);
      [button setImage:buttonImage forState:UIControlStateNormal];
  
  
      //create a UIBarButtonItem with the button as a custom view
      //UIBarButtonItem *customBarItem = [[UIBarButtonItem alloc] initWithCustomView:button];
  
      [button addTarget:self action:@selector(clickActionItem) forControlEvents:UIControlEventTouchUpInside];
      [self.view addSubview:button];
  }
  
  -(void)btnClicked
  {
      [self.button Sethidden:YES]:
      self.button.hidden=YES;
      _button.hidden=YES;
  }
  </code></pre>
  
  <p>But not work </p>