2012-02-04 49 views
0

我想UIPicker开始从(将不显示0,1)2UIPickerView值

self.tmpArray = [NSMutableArray arrayWithCapacity:10]; 

    for(int x = 2; x < 10; x++) 
    { 
     [self.tmpArray addObject:[NSNumber numberWithInt:x]]; 
    } 

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { 

    return [self.tmpArray count]; 
} 

通过上面UIPicker的代码显示0,1,2,3等等

回答

0

你'不会以任何方式传递tmpArray中的值,因此它们与UIPickerView显示的内容无关。

您需要实现viewForRow:forComponent:并且能够在拾取器视图请求它们时提供合适的视图。