文字列には、mild,medium,hot
という文字列があります。この文字列をコンマで区切って区切ります。pickerViewでも印刷します。
次のコードを使用し、List countを3として正常に取得しました。Iphone:コンマで区切られた文字列を分割し、それぞれの行をpickerviewの行に出力します。
NSString *spList=[mdict objectForKey:@"spicinesstype"];
NSArray *list = [spList componentsSeparatedByString:@","];
NSLog(@"List count:%d",[list count]);
return [list count];
しかし、どのように私はあなたがあなたのピッカー
- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {
return [array count];
}
- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return [array objectAtIndex:row];
}
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
お返事ありがとうございます – nithin