title: Objective-c , Setting two views of gradient , but only one correct
body: <p>I have a question. Have any can give me some hint?</p>
  
  <p>I set two View in storyboard.</p>
  
  <p>I build a AbstractViewController, this class is extends UIViewController.</p>
  
  <p>Then my IndexViewController extends AbstractViewController.</p>
  
  <p>My gradient code is write in AbstractViewController.</p>
  
  <p>Code is below.</p>
  
  <pre><code>-(UIView *) setGradientView:(UIView *) gradientView initColor:(UIColor*) initColor     andFinshColor:(UIColor*)finshColor
  {
  
      {
          initColor =[UIColor whiteColor] ;
  
      }
  
      if( finshColor == nil )
      {
          finshColor = [UIColor colorWithRed:230.0f/255.0f green:230.0f/255.0f     blue:230.0f/255.0f alpha:1.0f];
      }
  
      CAGradientLayer *gradient = [CAGradientLayer layer];
      gradient.frame = gradientView.bounds;
      gradient.colors = [NSArray arrayWithObjects:(id)[initColor CGColor],(id)[finshColor     CGColor],nil];
      [gradientView.layer insertSublayer:gradient atIndex:0];
      return gradientView;
  
  }
  </code></pre>
  
  <p>Then I call gradient in IndexViewController.
  I am write in viewDidLoad.</p>
  
  <p>code below:</p>
  
  <pre><code>[self setGradientView:_bgView initColor:nil andFinshColor:nil];
  [self setGradientView:_bottomView initColor:[UIColor colorWithRed:10.0f/255.0f     green:10.0f/255.0f blue:1.0f/255.0f alpha:1.0f]
          andFinshColor:[UIColor colorWithRed:10.0f/255.0f green:10.0f/255.0f     blue:10.0f/255.0f alpha:1.0f]];
  </code></pre>
  
  <p>The result only _bgView have change color. The _bottomView is not changed.</p>
  
  <p>I'm confuse about _bottomView not changed color.</p>
  
  <p>Have any one know?</p>
  
  <p>Thank you~</p>