title: Programmatically set UILabel has blurry text (integer frame values)
body: <p>I have a view where I programmatically set a UILabel in <code>viewDidLoad</code>. The text on that label is blurry. The code:</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
  
      [self setTitle:tAddSystemScreenTitle];
      CGRect rect = CGRectMake(10,0,300,80);
      UILabel *messageLabel = [[UILabel alloc] initWithFrame:rect];
  
      [messageLabel setOpaque:NO];
      if (shouldShowControlForRemoteAccess) {
          [messageLabel setText:kRemoteAccessInfoMessage];
          [messageLabel setNumberOfLines:2];
      } else {
          [messageLabel setText:kOneSystemAlreadyAssociatedAlertString];
          [messageLabel setNumberOfLines:4];
  
          rect.size.height += 30;
          [messageLabel setFrame:rect];
  
          rect = dataTable.frame;
          rect.origin.y += 30;
          rect.size.height -= 30;
          [dataTable setFrame:rect];
      }
      NSLog(@"x: %f, y: %f, w: %f, h: %f", messageLabel.frame.origin.x, messageLabel.frame.origin.y, messageLabel.frame.size.width, messageLabel.frame.size.height);
      [messageLabel setBackgroundColor:[UIColor clearColor]];
      [messageLabel setShadowColor:[UIColor blackColor]];
      [messageLabel setTextColor:[UIColor blackColor]];
      [messageLabel setTextAlignment:UITextAlignmentLeft];
      [messageLabel setShadowOffset:CGSizeMake(0,-1)];
      [self.view addSubview:messageLabel];
  
      NSLog(@"x: %f, y: %f, w: %f, h: %f", self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height);
  
      [dataTable setScrollEnabled:NO];
  
      [messageLabel release], messageLabel = nil;
  }
  </code></pre>
  
  <p>When I checked what the frame values were, I got the following:</p>
  
  <pre><code>x: 10.000000, y: 0.000000, w: 300.000000, h: 80.000000
  </code></pre>
  
  <p>Checking the same for <code>self.view</code> gets:</p>
  
  <pre><code>x: 0.000000, y: 20.000000, w: 320.000000, h: 460.000000
  </code></pre>
  
  <p>The <a href="https://stackoverflow.com/questions/2047294/blurry-uilabel-as-programmatic-subview-of-uitableviewcell-contentview">only</a> <a href="https://stackoverflow.com/questions/8065892/blurry-uilabel-when-added-programatically">other</a> <a href="https://stackoverflow.com/questions/1927815/blurry-uilabel-text-in-accessory-view-of-mkannotationview">questions</a> I could find on this issue suggested that I needed integer numbers for the frame, but as you can see I already have integer numbers. I tried the solution they recommended, using <code>CGRectIntegral(rect)</code> to replace all the places I had just <code>rect</code>, but that didn't work. How do I prevent the text from blurring?</p>