swift - section 的使用不明确

标签 swift tableview swift3 xcode8

我有一个奇怪的问题,在所有使用 tableView 的方法中都有错误。我不能使用 indexPath。有任何想法吗。 ??

 import UIKit
 import GoogleMaps
 import GooglePlaces

 class MapViewController: UIViewController, CLLocationManagerDelegate,
    GMSMapViewDelegate, UITextFieldDelegate, UITableViewDataSource,
    UITableViewDelegate {

enter image description here

enter image description here

最佳答案

如果你想使用indexPath,请遵循以下代码:

 let index = indexPath as NSIndexPath
 let row = índex.row

我不知道为什么编译器会混淆。

关于swift - section 的使用不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40535485/

相关文章:

swift - 无法将类型 'NSRange'(又名“_NSRange”)的值转换为预期参数类型 'Range<Data.Index>'(又名“Range<int>

arrays - 在 swift 3 中从数组中删除特定对象

ios - 当变量满足条件时显示 UIView

ios - 国际化 UIButton

JavaFX 桌面 View 滚动条事件未触发

ios - 为什么 float 值在 playground 中四舍五入而不是在 Swift 的项目中?

ios - Xcode UITableView 图像在模拟器上未正确对齐

swift - 无法在 tableview Swift 4 中查看 Firebase 数据

swift - iOS Swift 委托(delegate)

iOS Swift Google Maps SDK 在特定缩放级别显示标记?