I am a little new to iOS and I am working with a UICollectionView
. My UICollectionView
cells are populated with values from my array from my restful server.
So I pull those down and assign the fields, ID, Name and text. When I tap a specific cell. I want to send the ID Of that cell (The ID which we just pulled down) and send it as a parameter to my php. So far I am populating my collectionview with the IDs, but my problem occurs when I tap the cell, I am unsure how to get the ID.In the didSelectCellAtIndex
method I am trying to get the cell id using
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
//dictionary[indexPath.row].;
cell.
However I am not sure how to refer to the property I want. Since in
cellForItemAtIndexPath
I defined the label I want as this
UILabel *myid=(UILabel *)[cell viewWithTag:1];
Any help to assigning the ID in the label to a variable to send to my php will be appreciated.