Search code examples
iphoneobjective-ccocoa-touchuislider

UISlider setValue "Leaking"


Hey hope someone can help as I am at my wits end with this!?

I have a UISlider. I would like it to move as progress of a task takes place (playing music).

Im setting its value as the continues events happen. (progress through the track)

-(void)updateSlider:(float)value {
    NSLog(@" %f ",value);
    [timeIndexSlider setValue: value animated:YES];
}

Logs state that the float value is fine..

but its just doesn't move and I get the no autorelease pool - just leaking message, that you would get from a thread without one in the console. There is no thread involved on my part.

Is there a problem updating a UISlider this often?

Is there another way of controlling the sliders movement?

Cheers


Solution

  • I think you're getting updates on another thread and then calling into UIKit on that thread.

    Try doing a performSelectorOnMainThread with a new method that does the update (maybe taking an NSNumber object).