views:

175

answers:

1

Hi,

I've the following method (SPIN) that select 7 values (taken from an array) into my multi-cols pickerview.

 for(int i = 0; i < 7; i++) {
  int newValue;

     newValue = [[array objectAtIndex:i] intValue];

  [picker selectRow:newValue inComponent:i animated:YES];
  [picker reloadComponent:i];
 }

The problem here is that while it's working perfectly on the simulator, on the iphone the animation is not smooth, while if i only select one element eveything works correctly.

So I would like to select one component at a time.

Anyone can help please?

Thanks

A: 

your computer is a lot faster than the iPhone is, so the animation will be smooth in the simulator, but it'll chug on the iPhone is you're not careful.

try reloading the components after you've set them and it should be a bit smoother:

for(int i = 0; i < 7; i++) {
 int newValue;
 newValue = [[array objectAtIndex:i] intValue];
 [picker selectRow:newValue inComponent:i animated:YES];
}

[picker reloadAllComponents];
pxl