생계유지형 개발자 69

[ios] Main.storyboard: warning: Unsupported Configuration: Medium Style before iOS 13.0

Loading Bar로 작명된 Application Indicator에서 다음과 같은 경고가 났다. Unsupported Configuration: Medium Style before iOS 13.0 경고 메세지를 없애는 방법은 1) 타겟 ios를 ios 13.0 이상으로 올리거나 2) 아래처럼 viewDidLoad() 메소드에 코드를 작성한다. // To solve this, Set your project's iOS Deployment Target to iOS 13.0 (or later). // If you cannot do that, choose one of the deprecated styles on the storyboad and // set Large style programmatically: ..

[ios] Completion handler passed to -[Connect.MainViewController webView:decidePolicyForNavigationAction:decisionHandler:] was called more than once

# 오류 WebView 함수에서 화면 왔다갔다 하는 중에 다음과 같은 오류가 발생하면서 앱이 멈춘다. Exception: "Completion handler passed to -[Connect.MainViewController webView:decidePolicyForNavigationAction:decisionHandler:] was called more than once" 위의 에러가 발생한 소스코드 위치는 아래에서 에러발생지점 이라고 표시한 라인이다. func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolic..

[ios] Exception: Could not instantiate class named WKWebView because no class named WKWebView was found

# 오류 Thread 1: Exception: "Could not instantiate class named WKWebView because no class named WKWebView was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)" # 원인 ViewController에서 WKWebView로 웹뷰띄우는 소스를 구현했을 때 WebKit framework 라이브러리를 프로젝트에 추가해주어야 한다. @IBOutlet var webView: WKWebView! # 해결

[ios] iOS 13 미만인 경우, SceneDelegate로 인해 실행 안될 때

Deployment Target이 iOS 13 미만인 상황에서는? Deployment Target이 iOS 13 미만인 상황에서도 UIScene과 UISceneDelegate를 사용할 수 있을까요? 만약 앱이 iOS 13 미만의 버전도 지원해야 한다면 어떻게 해야할까요? iOS 12 이하는 하나의 앱에 하나의 window를 가지고 있기 때문에(즉, multi window를 사용하지 않기 때문에) iOS 13에서 추가된 부분을 삭제하고 이전 버전(~iOS12)과 설정을 똑같이 바꿔주면 이전 방식대로과 동일하게 할 수 있습니다. 방법은 Xcode를 새로 열고 iOS13에서 새로 생긴 SceneDelegate.swift 파일 삭제 iOS13에서 AppDelegate에 추가된 UISceneSession과 관련된..

[ios] UIWebView -> WkWebView 전환

참고 - WKWebView An object that displays interactive web content, such as for an in-app browser. Web View를 사용하는 앱 업데이트 (2019년 12월 23일) 귀하의 앱이 더 이상 사용되지 않는 UIWebView API를 사용하여 웹 콘텐츠를 포함하는 경우, 보안 및 안전성 향상을 위하여 WKWebView로 신속히 업데이트할 것을 권고해 드립니다. WKWebView는 앱의 웹 처리를 제한하여 문제가 발생한 웹 콘텐츠가 앱의 나머지 부분에 영향을 미치지 않도록 합니다. 또한 WKWebView는 iOS, macOS 및 Mac Catalyst에서 지원됩니다. App Store는 2020년 4월부터 UIWebView를 사용하는 새로운..

[Elasticsearch in java] client는 언제 close해 주어야 할까?

Java로 Elasticsearch에 접근로그 데이터를 저장 및 검색하는 기능을 개발했다. 사용자 유입이 많은 서비스라 하루에도 150만 건 정도의 접근로그가 저장되고 있었다. Elasticsearch에 연동하기 위해 두 개의 TransportClient 타입의 Client 객체를 생성했다. 하나는 접근로그 저장을 위한 clientForWrite, 또 하나는 검색을 위한 clientForSearch이다. 여기서 의문이 생겼다. Client는 언제 생성하고, 언제 닫아주어야 할까? 사용 빈도가 크지 않은 반면 JVM을 비롯한 리소스 관리가 필요한 상황이라면 작업이 필요할 때만 client를 생성하고 작업이 끝나면 닫아주면(close() 메소드 호출) 되겠지만, 접근로그 데이터가 거의 실시간으로 발생하기 때..

[Spring] proprteis 파일 한글 깨짐

# 변경 전 (한글 깨짐) # --------------------------------- # message-locale_ko_KR.properties # --------------------------------- common.day1=\uc77c common.day2=\uc6d4 common.day3=\ud654 common.day4=\uc218 common.day5=\ubaa9 common.day6=\uae08 common.day7=\ud1a0 common.btn1=\uc870\ud68c common.btn2=\ub4f1\ub85d common.btn3=\uc800\uc7a5 common.btn4=\uc0ad\uc81c # 변경 방법 1) 설정(맥 기준 Preferences) > Editor > F..

[Elasticsearch] 데이터 대량 검색 (2) - Scroll vs Search After

엘라스틱서치로 대량의 데이터 검색하기 위한 방법으로 두 가지가 있다. 하나는 Scroll을 이용한 방법이고 두 번째는 Search After를 이용한 방법이다. 둘 다 대량의 데이터를 검색하기 위한 방법이지만, 동작 방식이 다르므로 목적과 상황에 따라 달리 사용하기를 권장하고 있다. Scroll While a search request returns a single “page” of results, the scroll API can be used to retrieve large numbers of results (or even all results) from a single search request, in much the same way as you would use a cursor on a tradi..

spring-restdocs로 API문서 자동화 실행 시 it could not be parsed as JSON or XML 발생

# 오류 spring-restdocs를 사용하여 API문서를 자동화하고자 테스트케이스를 개발하고 있었다. 공식가이드와 블로그를 참고하여 개발하였는데 아래와 같은 오류가 계속 발생했고 실행 후에 계속 request-fields.adoc 파일의 내용이 비어있었다. Cannot handle application/x-www-form-urlencoded;charset=UTF-8 content as it could not be parsed as JSON or XML org.springframework.restdocs.payload.PayloadHandlingException: Cannot handle application/x-www-form-urlencoded;charset=UTF-8 content as it co..

Node.js와 npm 실행 시 icu4c 오류 (Reason: image not found)

npm 실행하니 아래와 같은 오류가 발생한다. $ npm dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.63.dylib Referenced from: /usr/local/bin/node Reason: image not found 얼마 전 Homebrew로 뭔가 설치하면서 icu4c 버전이 바뀌었다. brew list로 icu4c 버전을 확인하니, 기존에 사용하던 icu4c 버전은 63이었는데 67로 새로 설치되었다. $ brew list icu4c --versions icu4c 67.1 구글링해보니 대부분 icu4c 라이버리를 다운그레이드하는 방법으로 해결하던데 나는 Node 버전을 11 -> 14로 올렸다. 그리고나서 Node 프로젝트는 ..