2017-11-09 2 views
-4

현재 프로젝트에서 작업 중이며 컴파일되지 않습니다.예상 선언 (컴파일되지 않음)

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { 
    if editingStyle == .delete { 
     self.contacts.remove(at: indexPath.row) 
     tableView.deleteRows(at: [indexPath], with: .fade) 
    } 

} 
    // Return false if you do not want the specified item to be editable. 

return true 
+0

어떻게 코드가 충돌 할 수 있습니까? 그것은 심지어 컴파일되지 않습니다. – rmaddy

+0

당신은'return true'를 함수 밖에서 그냥 앉아 있습니다. 그것을 제거하십시오 – Paulw11

답변

0

시도해보십시오. 나는 return true이 거기에 속하지 않는다고 가정하고 있습니다. 메서드 외부의 값은 반환 할 수 없습니다.

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { 
    if editingStyle == .delete { 
     self.contacts.remove(at: indexPath.row) 
     tableView.deleteRows(at: [indexPath], with: .fade) 
    } 
}