title: Dynamic Variable Names iOS
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2231783/create-multiple-variables-based-on-an-int-count">create multiple variables based on an int count</a><br>
    <a href="https://stackoverflow.com/questions/2283374/objective-c-equivalent-of-phps-variable-variables">Objective C Equivalent of PHP&#39;s &ldquo;Variable Variables&rdquo;</a>  </p>
  </blockquote>
  
  
  
  <p>I'd like to use some dynamic variable names in a for loop and am stumped as to how to actually reference the variables.</p>
  
  <p>I have a series of UILabels title <code>poll0</code> - <code>poll8</code>. Using a for loop, I set their <code>text</code> value to another value referenced from that corresponding number in an array. For example:</p>
  
  <pre><code>for (int i = 0; i &lt; [pollData count]; i++) {
      label(i value).text = [NSString stringWithFormat:@"%@", [[pollData objectAtIndex:i] toString]]; //sorry for the java-esque method names, just create what I'm used to
  }
  </code></pre>
  
  <p>How do I use that <code>i</code> value?</p>