본문 바로가기
[도서 정리] Android Development with Kotlin - Laying a Foundation Android Development with Kotlin - Laying a Foundation 이 정리글은 Kotlin in Action 책을 보고 실무에 Kotlin 을 사용하던 사람이 몰랐던 내용이나 remind 하고 싶은 내용을 위주로 정리한 글입니다.제대로 내용을 파악하시려면 책을 구매해서 읽어보세욤~ -Kotlin type inference 가 생기면서 가끔 무슨 type 으로 inference 가 되었는지 확인하고 싶을 수 있다."expression type” 기능을 사용하면 된다.[View] - [Expression Type] 을 사용하면 된다. ( 혹은 이 녀석을 지정한 단축키 ) 이는 generic type 에 대해서도 잘 작동한다. -var age: Short = 18 과 같이 적절한.. 2018. 12. 11.
[Kotlin] Kotlin 의 숨겨진 비용 #1 [Kotlin] Kotlin 의 숨겨진 비용 #1 https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-1-fbb9935d9b62 -“With great power comes great responsibility” 를 기억해야 한다.( 간단한 코드를 짜는 대신 대가가 있다는 얘기다 ) -Kotlin bytecode inspector 를 사용하면 Kotlin 코드가 어떻게 bytecode 로 변환되는지 볼 수 있다.Android studio plugin 으로 접할 수 있다.이를 보면 primitive type 의 boxing, code 에서 보이지 않는 기타 object 들의 instantiation, 그리고 각종 추가 method 들의 추.. 2018. 1. 16.
[Objective-C] 블록 객체 [Objective-C] 블록 객체 출처 : OS X 구조를 이해하면서 배우는 Objective-C Chap 14. Notice : 정리자(돼지왕 왕돼지)가 remind 하고 싶은 내용이나 모르는 내용 기반으로 정리하는 것이기 때문에 구체적인 내용은 책을 사서 보시기를 권장드립니다. 14.1. 블록 객체란 * 14.1.1. C 컴파일러와 GCD -다른 프로그래밍 언어에서는 클러져 (closure)라고 하는 기능에 해당한다. -Mac OS X 10.6 및 iOS 4 부터 멀티 코어에서 스레드가 더 효율적으로 동작하도록 그랜드 센트럴 디스패치(GCD : Grand Central Dispatch)라는 구조 도입 * 14.1.2. 블록 객체 정의 -^ 부터 인수열, 본체의 마지막 괄호가 나올 떄까지의 블록 객체.. 2018. 1. 6.
[ios] extern 변수에 nullability 지정하기 [ios] extern 변수에 nullability 지정하기 -nullability 에 대한 호환이 100% 갖춰지지 않아서인지 이 글을 쓰는 시점에 순서가 명확하지 않은 부분들이 있다. -아래와 같은 순서로 type 과 const 사이에 써 주면 된다.extern NSString * _Nonnull const kTESTMyConst; const, nullability, [ios] extern 변수에 nullability 지정하기, _Nonnull, _Nullable, 위치 2017. 12. 16.
[Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces [Kotlin Tutorial] 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces 참조 : Kotlin in Action 4.1. Defining class hierarchies 4.1.1. Interface in Kotlin -Kotlin 의 interface 는 Java8 과 비슷하다.abstract method 를 가질수도 있고, Java8의 default method 도 가질 수 있다. ( Java8 과는 다르게 default keyword 는 필요없다 )단, state 는 여전히 가질 수 없다. ( 실제 variable ) -Kotlin 에서 interface 정의는 아래와 같다.interface Clickable{ fun.. 2017. 8. 11.
[Kotlin Tutorial] 함수 정의하고 호출하기 #1 - Chap 3. Defining and calling functions [Kotlin Tutorial] 함수 정의하고 호출하기 #1 - Chap 3. Defining and calling functions 참조 : Kotlin in Action 3.1. Creating collections in Kotlin -아래와 같이 쉽게 collection 을 만들 수 있다."type”Of 의 form 이다.val hashSet = hashSetOf(1, 7, 53) // mutableval set = setOf(“Gamza”, “Goguma”) // immutable val list = arrayListOf(1, 7, 53) // mutable val map = hashMapOf(1 to “one”, 7 to “seven”, 53 to “fifty-three”) // mutable/.. 2017. 8. 3.
[Effecitve Objective-C] #4 전처리기 #define 보다는 타입이 있는 상수를 사용하라 [Effecitve Objective-C] #4 전처리기 #define 보다는 타입이 있는 상수를 사용하라 출처 : Effective Objective-C -#define 은 전처리기 지시어이다. (preprocessor) -#define 정의는 타입에 대한 정보가 없다. -#define 이 헤더 파일에 선언되어 있다면 그 헤더 파일을 포함하는 모든 곳에서 #define 으로 정의한 상수값을 치환한다. -preprocessor 보다는 상수를 정의하는 것이 항상 더 좋은 방법이다. // implementation static const NSTimeInterval kAnimatinoDuration = 0.3; @implementation @end -상수의 일반적인 표기법은 k 소문자를 상수 맨 앞에 붙이는 .. 2017. 7. 24.
[Objective-C] Constant(상수) 정의하기 [Objective-C] Constant(상수) 정의하기 http://stackoverflow.com/questions/17228334/what-is-the-best-way-to-create-constants-in-objective-chttps://soulpark.wordpress.com/2012/08/02/objective_c_static_variable/ -Internal & Single class 용으로 상수를 정의한다면 static const 를 넣어준다. -Single class 에서 정의되지만 외부에서도 사용하는 public 개념의 상수를 만든다면extern 을 사용하면 된다. // headerextern NSString *const kConst; // implementationNSString.. 2017. 7. 23.
[iOS] 연락처 property constant 정리 [iOS] 연락처 property constant 정리 https://developer.apple.com/library/ios/documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/index.html#//apple_ref/doc/constant_group/Personal_Information_Properties Personal Information Property const ABPropertyID kABPersonFirstNameProperty;const ABPropertyID kABPersonLastNameProperty;const ABPropertyID kABPersonMiddleNameProperty;const ABPropertyID kABPerson.. 2017. 6. 24.
반응형