Ios 我想在ui选择器视图中为第一个组件使用日期
我试图在选择器视图中为第一个组件使用日期。我想将另一个组件与另一个数组一起使用Ios 我想在ui选择器视图中为第一个组件使用日期,ios,uipickerview,Ios,Uipickerview,我试图在选择器视图中为第一个组件使用日期。我想将另一个组件与另一个数组一起使用 请帮帮我…谢谢您将需要2个阵列,对吗?然后声明并填充将在两个组件中使用的两个数组,如下所示: NSArray *firstComponentArray = // populate the first array here NSArray *secondComponetArray = // populate the second array here . . . - (NSInteger) numberOfComp
请帮帮我…谢谢您将需要2个阵列,对吗?然后声明并填充将在两个组件中使用的两个数组,如下所示:
NSArray *firstComponentArray = // populate the first array here
NSArray *secondComponetArray = // populate the second array here
.
.
.
- (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
// return the number of components do you need
}
// return the right number of items in picker view delegate: numberOfRowsInComponent
- (NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent(NSInteger)component
{
// first component
if ( component == 0 )
// return the count of the first array
// second component
else
//return the count of the second array
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
// first component
if ( component == 0 )
// return the content of the first array at index using row
// second component
else
// return the content of the second array at index using row
}
就像我们可以从数组中添加一样,所以我想在数组中添加相同的所有日期