2017/05 썸네일형 리스트형 [swift3] convert Dictionary to Data, Data to String in swift3 1. Dictionary to Datalet dataExample: Data = NSKeyedArchiver.archivedData(withRootObject: dictionaryExample)2. Data to Dictionarylet dictionary: Dictionary? = NSKeyedUnarchiver.unarchiveObject(with: dataExample) as! [String : Any]3. String to Datavar somedata = testString.data(using: String.Encoding.utf8)4. Data to Stringvar backToString = String(data: somedata!, encoding: String.Encoding.utf8) .. 더보기 [iOS]Pods framework not found ... error 1. CocoaPods 다운로드 - sudo gem install cocoapods 2. CocoaPods 설치 - pod setup 3. CocoaPods profile 생성 - pod init 4. 생성된 CocoaPods profile 에 라이브러리 설정# platform :ios, '6.0' 더보기 [android] JSONObject 형식의 String에 탭 넣기. _ Insert tab into JSONObject String parsing된 data가 JSONObject 형식 또는 JSONObject 형식의 String 일 경우. 또는 JSONObject로 변환 가능한 모든 데이터 클레스. 일단 어떤 형식이든 JSONObject 형으로 변환이 먼저 필요하다. GSON Library가 있으면 변환가능. https://github.com/google/gson 참조 JSON String -> new JSONObject(JSON String); data class -> new JSONObject(new Gson().toJson(data class)); 변환된 JSONObejct 구분자에 탭을 포함한 String 으로 변환. JSONObject.toString(4); // 일반적으로 Tab Size는 4 변환 전 {"key":{"ke.. 더보기 이전 1 다음