I have a UIPickerView object that has five rows that a user can select. I want to return the index of the row that the user selects on IBAction. When my method is called, I can return the text of the value of what the user selected with this code:
NSString * userChoice = [self pickerView:picker titleForRow:[picker selectedRowInComponent:0] forComponent:0];
I want to now return as an NSInteger, the row that is returned. The following code kills the program and I don't know why:
NSLog(@"hello?? %@", [picker selectedRowInComponent:0]);
Any thoughts?? Is there a better method to use besides selectedRowInComponent?