Basically I have a class setup with a UICollectionView and a UIPickerView. As I have it now the picker pops up when a user clicks on a button within a cell. What I am trying to do is have the text fields value change when the user selects something from the picker. Here is how I have it setup but nothing is appearing when I change the value in the picker:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
static NSString *CellIdentifier=@"cell";
activityCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
UITextView *nameLabel = (UITextView *)[cell viewWithTag:1];
nameLabel.text = [NSString stringWithFormat:@"%@ %@",[arrayHour objectAtIndex:[pickerView selectedRowInComponent:0]], [arrayMinute objectAtIndex:[pickerView selectedRowInComponent:1]]];
In the code you provided, you’re just setting the text once, not maintaining a live link to the text. You need to keep track of which cell the picker view is being presented from (for example, with an ivar), and in the delegate method
-[UIPickerViewDelegate pickerView:didSelectRow:inComponent:], set the text of the label again.