views:

77

answers:

1

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

A: 

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.

Rudiger
hi...In my Application looping properly functioning but uiview having uiimageview as a subview which is not updating at the end of the loop(-0.00)slider and audioplayer reach end of the song.After ending loop properly working to play next song but uiview not updating....
waiting for your reply.reply plz...
Im having trouble reading / understanding you. With what I think you are telling me though if you are looping lots on the main thread you will block the UI, if you are looping in a child thread you will not be able to update the UI, you have to call a method on the main thread to update the UI from your child thread
Rudiger