title: UITextView textColor automatically becoming the same as the background color
body: <p>I have some code that creates a bunch of <code>UITextViews</code> and puts them into another view. I change the backgroundColor to alternating colors and always set the textColor to black. They all work out fine, except for the last one that it creates. That one changes it's textColor to whatever the backgroundColor of the text view is and then stops updating it's UI. </p>
  
  <p>If I check the value of textColor of the problematic in GDB, it is black, even though it isn't displayed that way. Then I change it programmatically (push a button, loop through all the created text views and set the textColors all to purple), they all change except for the last one, who's background color is the same as it's text color. Again, when I check in GDB, the value of textColor, it is set at purple, even though this is not reflected on the screen.</p>
  
  <p>WTF?!?!?! Any ideas? Could this just be a bug?</p>
  
  <p>Here's the code I'm using to add the <code>UITextViews</code>. I have UILabels in between so I can get centered text.</p>
  
  <pre><code>UIColor *evenColor = [self RGBColorR:90 G:95 B:90];
  UIColor *oddColor = [self RGBColorR:70 G:75 B:70];
  
  if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
      // Loop through adding the buttons.
      for (int i = 0; i &lt; numberOfSections; i++) {
          // Add the label for the actual title of the level.
          UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, ((i * sectionHeight) - 1), self.levelLablesView.frame.size.width, 30)];
          [label setText:[levels objectAtIndex:i]];
          label.font = [UIFont fontWithName:@"Helvetica-Bold" size:24];
          [label setTextAlignment:UITextAlignmentCenter];
          [label setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
          if (i % 2 == 0) {
              // It's an even number.
              [label setBackgroundColor:evenColor];
          } else {
              // Its an odd number.
              [label setBackgroundColor:oddColor];
          }
          [self.levelLablesView addSubview:label];
          [label release];
  
          // Add a scrolling UITextView for the other stuff.
          UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, ((i * sectionHeight) + 24), self.levelLablesView.frame.size.width, (sectionHeight - 24))];
          [textView setText:[[[dictionary objectForKey:self.chosenCategory]
                              objectForKey:[levels objectAtIndex:i]]
                             objectForKey:@"Description"]];
          [textView setEditable:NO];
          [textView setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
          if (i % 2 == 0) {
              // It's an even number.
              [textView setBackgroundColor:evenColor];
          } else {
              // Its an odd number.
              [textView setBackgroundColor:oddColor];
          }
          if (i == (numberOfSections-1)) {
              [textView setFrame:CGRectMake(0,((i * sectionHeight) + 24), self.levelLablesView.frame.size.width, ((sectionHeight - 24) + 2))];
          }
          textView.font = [UIFont systemFontOfSize:24];
          [textView setTextColor:[UIColor blackColor]];
  
          [self.levelLablesView addSubview:textView];
          [textView release];
      }
  
  }
  </code></pre>
  
  <p><strong>Edit:</strong> In case anyone is wondering, I don't set the text color anywhere else in the program by accident. I did a find for "textColor" and the only matches I get are irrelevant. </p>