Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIPickerView按顺序选择多个组件中的行(一个接一个)_Iphone_Objective C_Cocoa Touch_Performance - Fatal编程技术网

Iphone UIPickerView按顺序选择多个组件中的行(一个接一个)

Iphone UIPickerView按顺序选择多个组件中的行(一个接一个),iphone,objective-c,cocoa-touch,performance,Iphone,Objective C,Cocoa Touch,Performance,我使用以下方法(SPIN)在multi-cols-pickerview中选择7个值(取自数组) for(int i = 0; i < 7; i++) { int newValue; newValue = [[array objectAtIndex:i] intValue]; [picker selectRow:newValue inComponent:i animated:YES]; [picker reloadComponent:i]; } for(int

我使用以下方法(SPIN)在multi-cols-pickerview中选择7个值(取自数组)

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

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

  [picker selectRow:newValue inComponent:i animated:YES];
  [picker reloadComponent:i];
 }
for(int i=0;i<7;i++){
int新值;
newValue=[[array objectAtIndex:i]intValue];
[picker selectRow:newValue不完整项:i动画:是];
[选择器重新加载组件:i];
}
这里的问题是,虽然它在模拟器上工作得很好,但在iphone上,动画并不平滑,而如果我只选择一个元素,一切都正常

所以我想一次选择一个组件

有人能帮忙吗


谢谢

你的电脑比iPhone快得多,所以动画在模拟器中会很流畅,但如果你不小心,它会在iPhone上发出嘎嘎声

设置组件后,尝试重新加载组件,这样会更平滑一些:

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

[picker reloadAllComponents];
for(int i=0;i<7;i++){
int新值;
newValue=[[array objectAtIndex:i]intValue];
[picker selectRow:newValue不完整项:i动画:是];
}
[选择器重新加载所有组件];