How to convert NSIndexpath into NSInteger or simply int?

后端 未结 6 1039
轻奢々
轻奢々 2021-01-30 20:34

I need to convert a nsindexpath var into NsInteger or simply an int. e.g:

 int rowIndex = [mGoogleBaseTable selectedRow];
 //mGoogleBaseTable is a NSTable type          


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 20:55

    In swift :

    1. Associate your collection view to your var :

      @IBOutlet weak var collectionView: UICollectionView!

    2. In prepareForSegue func, you can call :

      var indexPath = collectionView.indexPathsForSelectedItems()

提交回复
热议问题