how can i reload (or) refresh the uiview?

3.5k Views Asked by At

HI,

I'm very new to iphone development.I'm doing one application in that app having more than one uiview.one uiview having uislider and uilabel.uislider is used to show the song timings and uilabel is used to shows the song count.while the timer shows(-0.00)that is the slider reach the end next song is correctly played but,the uilabel not showing the count of next song always it shows the (1 0f 5)only...and another uiview named as v_lyrics while the next song playing lyrics view also not updating...I think the only problem in this is view and label not properly refreshing...

code: use this code for label refreshing:

[label setNeedsDisplay];
[label performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:YES];

code for view refreshing:

[v_lyrics setNeedsDisplay];

plz tel me how can i refresh both uilabel and uiview...where should i give this code...

Thank you... Renya

1

There are 1 best solutions below

2
On

setNeedsDisplay in a nut shell calls the drawRect method in UIView. I doubt from your explanation this is where your problem lies. I notice that you are threading your operations, updating your UI can only be done on the main thread. Perhaps thats where your problem lies.