-
카테고리
-
세부 분야
모바일 앱 개발
-
해결 여부
해결됨
Type 'Any' has no subscript members 에러 때문에 컴파일 안 돼요 어떻게 해야 돼요?
16.10.06 03:16 작성 조회수 193
0
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return datalist["weatherinfo"]!["local"]!!.count
! Type 'Any' has no subscript members
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! WeatherCell
// var dicTemp = datalist[indexPath.row]
let dicTemp = datalist["weatherinfo"]!["local"]!![indexPath.row]
! Type 'Any' has no subscript members
답변을 작성해보세요.
1
뭐하는거니?
지식공유자2016.10.06
죄송한데 Xcode 버전이 달라서 그런거 같습니다.
Swift3가 적용된 Xcode를 사용하셔서 생기는 문제 입니다.
Swift3강좌에서 바뀐부분 다 적용해서 다시 만들었거든요.
Swift2 -> Swift3로 오면서 라이브 러리와 문법들이 조금 바뀌었습니다.
현재는 Swift3용 Xcode로 Swift2코드를 작성 하셔서 그렇습니다.
답변 1