Shm*_*idt 7 objective-c ios6 uicollectionview
我试过了:
- (IBAction)delete:(UIButton*)sender{
NSIndexPath *indexPath = [self.collectionView indexPathForCell:(TourGridCell *)[[[sender superview]superview]superview]];
}
Run Code Online (Sandbox Code Playgroud)
但NSLog显示单元格存在,但indexpath为零.
Shm*_*idt 26
好的,这是:
- (IBAction)delete:(UIButton *)sender{
NSIndexPath *indexPath = nil;
indexPath = [self.collectionView indexPathForItemAtPoint:[self.collectionView convertPoint:sender.center fromView:sender.superview]];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5393 次 |
| 最近记录: |