반응형
arrays, dictionaries, sets 같은 컬렉션은 removeall 할 때 다 지워진다. 정말루... 지우고 새로 생성해 줘야 한다.
jhDataCenter.nonNetworkData.removeAll()
하고 데이터 넣지맛!
_ = json["data"]["glucose"]["cgm"].arrayValue.map({
.
.
.
jhDataCenter.mDatas.removeAll(keepingCapacity: true)
얘도 마찬가지... 걍 지우고 다시 만들어 주는 clean 함수를 만드는게 낫다.
public static func clean() {
jhDataCenter.mDatas.removeAll()
jhDataCenter.mDatas = [0:hjh(d: Array<sss>()), //CGM
1:hjh(d: Array<sssss>()), //bolus
2:hjh(d: Array<sssss>()), //Basal
3:hjh(d: Array<sss>()) //BG
]
}
반응형
'HJH IT Logs' 카테고리의 다른 글
삼항 연산자는 언제쓸까? (1) | 2019.01.14 |
---|---|
탭바 컨트롤러 인덱스 알아내기 (0) | 2019.01.14 |
추리와 추론의 차이 (0) | 2019.01.14 |
Practical Swift (0) | 2019.01.14 |
홍콩 (6) | 2019.01.14 |
최근댓글