I am trying to grab a string in my array, change nth letter in the string to a ?, then print the result in a textfield. The problem is my NSMutableArray is being stored into a UIPickerView and I think it would be best just to read the string from the PickerView then change the nth char and print the result. I am struggling with how to grab the string from the picker and change the nth letter.
- (UIView *)viewForRow:(NSInteger)row forComponent:(NSInteger)component
{
if (row == 0 ) {
NSString *originalStringTwo = @"%@", *arrayDictionary;
NSRange two = [originalStringTwo rangeOfString:@"2"];
NSString *newStringTwo = [originalStringTwo stringByReplacingCharactersInRange:two withString:@"?"];
_resultLabel.text = newStringTwo;
}
if (row == 1 ) {
NSString *originalStringThree = @"%@", *arrayDictionary;
NSRange three = [originalStringThree rangeOfString:@"3"];
NSString *newStringThree = [originalStringThreestringByReplacingCharactersInRange:three withString:@"?"];
_resultLabel.text = newStringThree;
}
if ( row == 2 ) {
NSString *originalStringFour = @"%@", *arrayDictionary;
NSRange four = [originalStringFour rangeOfString:@"4"];
NSString *newStringFour = [originalStringFour stringByReplacingCharactersInRange:four withString:@"?"];
_resultLabel.text = newStringFour;
}
return 0;
}