2
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSMutableDictionary *tabsDict = [tabs objectAtIndex:indexPath.row];
    NSString *identifier = [tabsDict objectForKey:@"destination"];
    NSString *title = [tabsDict objectForKey:@"name"];

    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];

    UILabel *label = (UILabel *)[cell viewWithTag:10];
    label.text = title;


    return cell;
}

When I run my app the UILabel is not recognized so no text is showing in the label in the cell. Could someone explain why it's not? I just started having this problem in Xcode 6.

Kara
  • 6,115
  • 16
  • 50
  • 57

2 Answers2

1

I answered for a similar kind of question

Possible answer for your question

Hope this helps.

Community
  • 1
  • 1
Vineeth Joseph
  • 5,177
  • 3
  • 17
  • 31
0

Struggled with this all of today and finally try to look up this xcode 6 bug.

This user's solution worked for me even though he's coding in swift.

https://stackoverflow.com/a/25535121/4385189

It looks like somehow the view we are trying to get hold of with viewWithTag is no longer the subview of the this view in different autolayout and up/downsampling of screen sizes. I also needed to change the auto layout selector below the storyboard to wAny hAny aka baselayout for all sizes.

Community
  • 1
  • 1
  • While this may provide the answer, it's not complete on its own as the post in the link may change or be deleted. Keep the link for reference and the acknowledgements, but you should at least write a summary of the linked solution here. It's more convenient to read the answer here instead of going though links for the same result. – Reti43 Jan 06 '15 at 15:45