小编Gia*_*cio的帖子

如何获取单元格中标签的值

我使用了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)

objective-c ios

2
推荐指数
1
解决办法
2050
查看次数

排序数组和对象

如何以相反的顺序在数组中订购这些值?

_gradientArrayToWhite = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10", nil];
Run Code Online (Sandbox Code Playgroud)

sorting objective-c nsarray

1
推荐指数
1
解决办法
72
查看次数

标签 统计

objective-c ×2

ios ×1

nsarray ×1

sorting ×1