강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của give144286
give144286

câu hỏi đã được viết

iOS9 & Swift2 Tìm hiểu phát triển ứng dụng iPhone bằng cách tạo 12 ứng dụng

120. Ứng dụng thời tiết - Phân tích JSON 5

Type 'Any' has no subscript members 에러 때문에 컴파일 안 돼요 어떻게 해야 돼요?

Đã giải quyết

Viết

·

334

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
iosswift

Câu trả lời 1

1

appstamp70006님의 프로필 이미지
appstamp70006
Người chia sẻ kiến thức

죄송한데 Xcode 버전이 달라서 그런거 같습니다. Swift3가 적용된 Xcode를 사용하셔서 생기는 문제 입니다. Swift3강좌에서 바뀐부분 다 적용해서 다시 만들었거든요. Swift2 -> Swift3로 오면서 라이브 러리와 문법들이 조금 바뀌었습니다. 현재는 Swift3용 Xcode로 Swift2코드를 작성 하셔서 그렇습니다.
Hình ảnh hồ sơ của give144286
give144286

câu hỏi đã được viết

Đặt câu hỏi