590Adding an UIAlertView
Unlike other UIViews, UIAlertView does not need to be added to another view via addSubView.
[myAlertView show] takes care of that.
Trivial, maybe. But I wasn’t aware of it.
[myLabel setNeedsDisplay];
I kind of worked. But only if I called from – for example a Button. It then updated the values of the UILabel. That’s was a step forward, but not really satisfying; after all I’d like have updates on the UILabel whenever they arrived. And again, calling if from the notification also did not do the trick.
Then I found out, that it order for UILabels to visually update, the update command has to be called on the main loop! Yeah! And how to perfom and action on the main loop?
Yes, with performSelectorOnMainThread:
So, the solution it an anti-climax and here it is:
[myLabel performSelectorOnMainThread:@selector(setText:)withObject:myText waitUntilDone:NO];
//