title: CGFloat array help - iPhone dev
body: <p>here is my code:</p>
  
  <pre><code>CGFloat components[8];//[8];// = {  0.6, 0.6, 0.6, 0.5, 0.4, 0.4, 0.4, 0.5 };
  if ([appDelegate.graphType isEqualToString:@"response"])
  {
      CGFloat components[8] = {  0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, 0.5 };
  }
  else 
  {
      if ([appDelegate.graphType isEqualToString:@"uptime"])
      {
          CGFloat components[8] = {  0.694, 0.855, 0.961, 0.5, 0.188, 0.588, 0.906, 0.5 };
      }
      else
      {
          CGFloat components[8] = {  0.694, 0.855, 0.961, 0.5, 0.188, 0.588, 0.906, 0.5 };
      }
  }
  </code></pre>
  
  <p>So basically, I want to draw different gradients based on different graph types. However, xCode shows me that CGFloat components[8] from if/else statements is unused and ignores its values. Any ideas what is the problem</p>