Download View Cell collection from storyboard (instead of nib with registerNib)

In Xcode 5.0.2, I am trying to recreate Michael Lehman's “Collection Example” for my video tutorial. Learning to create applications for iPhone and iPad (password protected by Safari, chapter 5).

Michael downloads the View Cell collection from the nib file with the following code (here is the full version of his ExploreUICollectionView / ViewController.m )

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.myCollectionView.delegate = self;
    self.myCollectionView.dataSource = self;

    self.cellData = [[NSMutableArray alloc]init];

    for(int i=0; i < 100; i++)
    {
        [self.cellData addObject:[NSString stringWithFormat:@"#%d", i+1]];
    }

    UINib *cellNib = [UINib nibWithNibName:@"CVCell"
                                    bundle:nil];
    [self.myCollectionView registerNib:cellNib
            forCellWithReuseIdentifier:@"CVCell"];
}

However, I would not want to create a separate nib file for the cell, but drag the View onto Main_iphone.stroryboardand Main_ipad.storyboard, if necessary, give it a "storyboard identifier" and then (somehow) use it in myCollectionView.

My question is , what methods should I name, please?

nibWithNibName registerNib:forCellWithReuseIdentifier .

: rdelmar (!):

enter image description here

+4
1

, . , . , , . . UICollectionViewCell, , .

+11

All Articles