title: How to hide/show the UIimageview?
body: <pre><code>- (void)viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:animated];
      CGRect viewRect = CGRectMake(250, 100, 30, 30);
      as = [[UIImageView alloc] initWithFrame:viewRect];
      as.backgroundColor=[UIColor clearColor];
      UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"check" ofType:@"png"]];
      [as setImage:img];
      [self.view addSubview:as];
      BOOL test= [[NSUserDefaults standardUserDefaults] boolForKey:@"switch"];
      NSLog(@"%@", (test ? @"YES" : @"NO"));
      if(test == YES)
          {
              as.hidden=NO;
          }
      else
          {
              as.hidden=YES;
          }
  }
  </code></pre>
  
  <p>The <code>test</code> results <code>YES</code>  but the <code>imageView</code> doesn't listen the command <code>.hidden</code> or update every time when the <code>viewDidAppear</code>.If it is not when I restart the app and it disappear after I turn it to yes I show perfectly but after than I never goes always there I can't make it hidden.
  any idea why it is not reacting?</p>