views:

536

answers:

1

I have two views, one view takes the whole screen, the second view covers only a little portion. What I want is for that second view to be on the first view (which I already have done), but the problem is, when I set values (in this case UILabel's) the label on the screen doesn't display that new value. I know for a fact the method gets called, but for some reason it won't change the label's value.

Edit: Here's the code:

-(void)loadHighScores
{   
[no1 setText:@"test"];
 NSLog(@"it works");
}

And here's how I call it:

    highscore = [[HighScore alloc] init];
    [highscore loadHighScores];
+1  A: 

Have you tried:

[myView setNeedsDisplay];

Quote from Apple docs:

By default, geometry changes to a view automatically redisplays the view without needing to invoke the drawRect: method. Therefore, you need to request that a view redraw only when the data or state used for drawing a view changes. In this case, send the view the setNeedsDisplay message. Any UIView objects marked as needing display are automatically redisplayed when the application returns to the run loop.

pheelicks
yea, but it still doesn't work.
Matt S.
In that case, can you post some more details of your code? How do you know for a fact that the labels are being set?
pheelicks
I NSLoged the method that is being called
Matt S.
Code please. The fact that you're loggingthe method in which the labels should be set doesn't prove they are set
pheelicks
There code posted
Matt S.