Как я могу получить правильное местоположение, когда я нажимаю на ячейку местоположения?Как настроить секцию и строку в UITableViewController?
Потому что в моей главной книге «Совет» есть две строки, первая - это местоположение, а вторая - ячейка выбора даты.
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
{
if indexPath.section == 2 && indexPath.row == 2
{
let authStatus = CLLocationManager.authorizationStatus()
if authStatus == .NotDetermined
{
locationManager.requestWhenInUseAuthorization()
return
}
if updatingLocation
{
stopLocationManager()
} else
{
location = nil
lastLocationError = nil
placemark = nil
lastGeocodingError = nil
startLocationManager()
}
updateLabels()
configureGetButton()
}
tableView.deselectRowAtIndexPath(indexPath, animated: true)
textField.resignFirstResponder()
if indexPath.section == 2 && indexPath.row == 1 { if !datePickerVisible {
showDatePicker()
}
else
{
hideDatePicker()
}
}}
пожалуйста, укажите, что вы точно хотите знать, Заголовок вопроса и описание кажутся разными .. – AnshaD
Я просто хочу, если indexPath.section == 2 && indexPath.row == 2 {...} если это правильно, то почему я не получу ответ после щелкните ячейку местоположения – Ashwini
Хорошо, Thats fine Итак, приведенный выше код не подходит для вас? right – AnshaD