我使用了UICollectionView,并使用了单元格来放置与我的值相关联的标签。当您插入单元格时,我想将文本带到所选标签,然后用它来做其他事情。我能怎么做?
使用此代码,我可以准确地返回到索引,但是我不能将单元格的内容放入字符串中。
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"Cell";
CustomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath];
NSString *strColorCell = cell.lblCustomCell.text;
NSLog(@"Indice della cella: %i %i %@", indexPath.item, indexPath.section * 2 + indexPath.row, strColorCell);
}
Run Code Online (Sandbox Code Playgroud) 如何以相反的顺序在数组中订购这些值?
_gradientArrayToWhite = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", nil];
Run Code Online (Sandbox Code Playgroud)