2016-12-29 36 views
-8

downloaed json data is in the format of dictionary and within that dictiionary i need data. so someone please help me to resolve this error(Type any? has no members)類型的任何具有SWIFT 3

let dict = booksArray[indexPath.row] 

title.text = dict["im:name"]!["label"] as? String 
descLabel.text = dict["im:releaseDate"]!["attributes"]!!["label"] as? String 
+0

請詳細說明,更多的努力。這樣我們可以更好地幫助你 –

+0

con你顯示你的數據? –

+5

你有沒有在發帖前嘗試搜索它,有關於這個問題的很多帖子,請查看http://stackoverflow.com/search?q=%5Bswift3%5D+Type+any+has+no+subscript+members –

回答

-1

我的解決辦法沒有下成員此

let dataArray = dict["im:releaseDate"] as! NSDictionary 

for item in dataArray { // loop through data items 
    if (item.key as! String == "attributes") { 
     descLabel.text = item.value as? String 
    } 
} 

我希望幫助

相關問題