tag

2020년 (1) 2단계 확인 (1) 공인인증 (1) 공인인증서 (1) 구글 넥서스 2세대 (1) 구글캐스트 (1) 네트워크 위치 (1) 데비안 (1) 도움말 (1) 멤버십 (1) 멤버십 무료 (1) 보안 (1) 소유권이전 (1) 시스템 관리 컨트롤러 재설정 (1) 애플 (2) 애플 뉴스 (1) 애플 보안 인증 (1) 애플 앱스토어 가이드라인 (1) 앱 이전 (1) 앱스토어 커넥트 (1) 업데이트 (1) 이중 인증 (1) 인증 (1) 인증 전환 (1) 자동회전 동작안함 (1) 자동회전 오류 (1) 크롬캐스트 (1) 키체인 (1) AFNetwork (1) align (1) android (1) Android 앱 이전 (1) apns (1) app 이전 (1) app store (1) App Store Connect (1) App Store Review Guidelines (1) App Tranport Security (1) app transfer (1) appcode (2) apple (4) apple developer program (1) apple news (1) AppStore (1) apt (1) apt-get (1) arm64 error (1) asus nexus (1) bitcode (1) bitcode_bundle (1) cast (1) chromecast (1) coredata (1) Could not connect to server (1) CPU (1) csrutil (1) csrutil disable (1) debian (2) debian install on macbook air (1) debian linux (1) debian mirror (1) delfino (1) el capitan (1) Enable Bitcode (1) error (2) ftp.kr.debian.org (1) google (1) google cast (1) google nexus 2nd (1) google play (1) harukasan (1) help appstore connect (1) html5 (1) image logo (1) Info.plist (1) ios (10) ios distribution signning (1) ios11 (1) ios13 sdk (1) iOS8 (1) iOS9 (2) ITMS-90474 (1) ITMS-90475 (1) itunesconnect (1) jessie (1) jetbrains (2) kernel_task (1) lanet (1) left align (1) linux (1) location (1) macbook air (1) MacBookPro8_2 (1) macOS (1) macoscatalina (1) MEMORY (1) must have (1) network location (1) networksetup (1) non-free (1) NSURLComponents (1) NSURLQueryItem (1) Objective-C (1) operation not permitted (1) optimize (1) osx (2) queryItems (1) SMC (1) softforum (1) sourcelist (1) sqlite (1) storyboard (1) swift (4) swiftui (1) system (1) systemstatus (1) tip (1) Transferring an App (1) uinavigationbar (2) UITabBar (1) UITabBarController (1) uiwebview (1) uninstall (1) uninstaller (1) url encode (1) User Experience Guidelines (1) VALID_ARCHS (1) Ventura (1) vim (1) watch os (1) wkwebview (1) WWDR (1) xcode (7) Xcode Help (1) Xcode IDE 도움말 (1) xcode12 (1) Xcode7 (4) Yosemite (1)

광고-자동

hell.o.world

tim toady

2017-05-31

NSURLComponents 를 이용한 NSURLQueryItem 사용시 URL Encode


NSURLComponents 를 이용한 NSURLQueryItem 사용시 URL Encode

iOS 8 이상에서 NSURLQueryItem를 사용해서 get 방식으로 보낼 url query key/value를 작성하게 되는데, 이 경우 자체적으로 URL encode를 하기 때문에 따로 urlencode 코드를 넣어주면 2중 encode가 되어 버린다.

https://developer.apple.com/reference/foundation/nsurlqueryitem/1572045-queryitemwithname?language=objc

개발자 문서 아래 Discussion 부분을 보면 key/value 모두 자동으로 인코딩을 하게 되므로  따로 하지 말고 한다.

To use the newly initialized query item in composing a URL, add it to the queryItems array of an NSURLComponents instance. Because assigning an array of query items to an NSURLComponents instance automatically encodes the name and value properties, you should not percent-encode these strings.

이는 ​iOS8 이상에서만 사용 가능한 class 이므로 iOS7 이하는 url query method를 구성 하고 필요한 경우 url encode 를 적용해야 한다.​