Swift-如何在int中转换indexPathForRowAtPoint值
我在Swift-如何在int中转换indexPathForRowAtPoint值,swift,integer,Swift,Integer,我在UITableView上使用了长按tappostate,然后我创建了一个变量indepath问题是如何将indepath值转换为整数,因为我在UITableView索引路径中使用了该值,所以我无法将该值用作整数 这是我的密码 func cellLongPressed(recognizer: UILongPressGestureRecognizer) { let point = recognizer.locationInView(tbl_LLTrandingJive) l
UITableView
上使用了长按tappostate
,然后我创建了一个变量indepath
问题是如何将indepath
值转换为整数,因为我在UITableView
索引路径中使用了该值,所以我无法将该值用作整数
这是我的密码
func cellLongPressed(recognizer: UILongPressGestureRecognizer) {
let point = recognizer.locationInView(tbl_LLTrandingJive)
let indexPath = tbl_LLTrandingJive.indexPathForRowAtPoint(point)
if indexPath == nil {
} else if recognizer.state == UIGestureRecognizerState.Began {
var getin:int = (indexPath?.row)?.toIntMax()
println("LONG indexPath_localTable:\(indexPath?.row)")
myarray.ovjecatindex(0)
}
获取所需的行数
indexPath.row //current row number in section
如果你有比
indexPath.section //current section number
不能直接将其转换为int,因为它是一个复杂的对象