how to get digits of a integer from NSString?

ipad, iphone, objective-c, uipickerview, xcode

Solution

Please see this..

NSMutableArray *arrNumbers = [[NSMutableArray] alloc] initWithCapacity:[YOURSTRING length]];

for (i=0;i<[YOURSTRING length];i++) 
{
  unichaar ch = [YOURSTRING characterAtIndex:i];
  NSLog(@"Processing charachter %c",ch);
  // If you really want
  [arrNumbers addObject:(id)ch];
}

Problem

I am having a string like `NSString *str = @"123"`.I want to fill the digits of this string into UIPickerView.But how to get the digits from this string?I added the following code ``` - (void)pickerView:(UIPickerView *)pickerView didSelectRow: (NSInteger)row inComponent:(NSInteger)component { int number = [str intValue]; if(component == 0) { } else if(component == 1) { } else { } } ```

Original source