1
놀이터에서이 코드가 작동 대 운동장은빠른 빈 사전 사전 버그? 프로젝트
var detaildata:Dictionary=[:]
detaildata = ["apple":"hello"]
detaildata["orange"]="byebye"
이 코드는
class ViewController: UIViewController{
var detaildata:Dictionary=[:]
override func viewDidLoad() {
super.viewDidLoad()
detaildata = ["apple":"hello"]
detaildata["orange"]="byebye" // Error -> 'Dictionary' is not identical to 'Dictionary<key,Value>'
}
}
그 이유를 알고 프로젝트
에서 작동하지 않습니다?동일한 코드라고 생각합니다.
을 좀 더 키/베일 dact1 + = 추가하려면 [ "오렌지"를 "바이 바이"] // 오류 내가 할 수있는 일을 잘 모르겠다 두 개의 사전을 병합하고 싶습니다 dict4 = dict1 + dict2 // 오류 PLZ를 도와 줄 수 있습니까? – user1272854
Apple의 [Swift 사전에 대한 설명서] (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html#//apple_ref/doc/uid/TP40014097-CH8)를 읽어야합니다. -XID_179) - 귀하의 모든 질문을 다루어야합니다. –