본문 바로가기
[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 5. Notice : 정리자(돼지왕 왕돼지)가 remind 하고 싶은 내용이나 모르는 내용 기반으로 정리하는 것이기 때문에 구체적인 내용은 책을 사서 보시기를 권장드립니다. 5.1. 동적 메모리 관리 * 5.1.1. 메모리 관리의 필요성 -이미 해제된 부분을 가리키는 위험한 포인터를 댕글링 포인터(dangling pointer) 또는 허상 포인터라고 부른다. * 5.1.2. 카운터 관리 방식과 ARC, 가비지 컬렉션 -Objective-C 2.0 에는 카운터 관리 방식과 다른, 가비지 컬렉션이라는 메모리 관리 방식도 이용할 수 있게 되었다.가비지 컬렉션은 프로그램의 일.. 2017. 12. 27.
[ios] Nullable & NonNull annotation [ios] Nullable & NonNull annotation -안드로이드에 보면 @Nullable, @NonNull 이라는 annotation 이 있어 API 사용에 대한 혜안을 주기 편리하다. -iOS 에도 있을까? -있다._Nullable 과 _Nonnull 이 그것이다. --(NSString* _Nullable)informationWithId:(NSString* _Nonnull)id; 위와 같은 문법으로 사용하면 된다. -_Nullable 과 _Nonnull 대신 nullable 과 nonnull 로 사용해도 된다.대신 이 경우에는 괄호의 처음에 온다.-(nullable NSString*)informationWithId:(nonnull NSString*)id; -property 에도 nullab.. 2017. 10. 30.
[도서 목차 정리] Kotlin in action [도서 목차 정리] Kotlin in action Kotlin in action 을 공부하면서 정리한 내용입니다.Java 를 어느 정도 이해하고 숙달한 사람들이 이해하기 좋습니다.Java 와 동일하거나 너무 당연한 기본적인 내용은 정리하지 않았습니다. Kotlin 소개 - Kotlin : what and why Kotlin 기초 #1 - Chap2. Kotlin basics Kotlin 기초 #2 - Chap2. Kotlin basics 함수 정의하고 호출하기 #1 - Chap 3. Defining and calling functions 함수 정의하고 호출하기 #2 클래스, objects, 그리고 인터페이스 #1 - Chap4. Classes, objects, and interfaces 클래스, obje.. 2017. 9. 25.
[Kotlin Tutorial] Building Kotlin projects [Kotlin Tutorial] Building Kotlin projects 참조 : Kotlin in action 1. Building Kotlin code with gradle -Kotlin 을 사용하는데 추천되는 build system 은 gradle 이다.gradle 은 incremental build 를 사용해서 빌드 속도도 빠르게 할 수 있고,gadle daemon 이 있어 build process 도 오래 살아있고, 기타 고급 기술들이 들어가 있다. cf) incremental build 는 빌드된 구성 요소 중 최신 상태인 구성 요소는 다시 빌드하지 않는 것을 이야기한다.즉 빌드된 적 없는 대상이나 만료된 대상만 다시 빌드하는 빌드방식을 incremental build 라 부른다. -Gra.. 2017. 9. 18.
[Kotlin Tutorial] Annotation 과 Reflection #2 [Kotlin Tutorial] Annotation 과 Reflection #2 참조 : Kotlin in action 10.2. Reflection: introspecting Kotlin objects at runtime -Kotlin 에서의 reflection 은 java.lang.reflect package 의 API 들과 kotlin.reflect package 의 API 들을 사용한다.Kotlin 의 reflection 은 Java 에 없는 nullable type 이나 properties 들의 접근을 가능하게 한다. -runtime lib 의 size 를 줄이기 위해, kotlin 의 reflection API 는 kotlin-reflect.jar 라는 별개의 jar 로 pakcage 되어 있.. 2017. 9. 12.
[Kotlin Tutorial] Annotation 과 Reflection #1 - Chap 10. Annotations and reflection [Kotlin Tutorial] Annotation 과 Reflection #1 - Chap 10. Annotations and reflection 참조 : Kotlin in action 10.1. Declaring and applying annotations. 10.1.1. Applying annotations -Annotation 사용법은 Java 와 동일하다. @ 를 prefix 로 하고 annotation name 을 써주면 된다. -@Deprecated 의 경우 Kotlin 은 Java 의 것에서 향상되었다.replaceWith parameter 가 추가되어, 새로운 version 의 API 에 연결될 수 있다.@Deprecated(“Use removeAt(index) instead.”, Rep.. 2017. 9. 7.
[Kotlin Tutorial] Kotlin 의 Type system - Chap6. The Kotlin type system [Kotlin Tutorial] Kotlin 의 Type system - Chap6. The Kotlin type system 출처 : Kotlin in action 6.1. Nullability 6.1.1. Nullable types -Kotlin 은 nullable types 를 지원한다.nullable type 이라는 것은 어떤 variable 이 null 을 가질 수 있는지를 명시하는 것이다. -nullable 하지 않은 곳에 null 을 넣으면 compile error 가 난다.기본 type 은 nullable 하지 않으며, nullable 을 만드려면 type 뒤에 ? 를 붙여주면 된다.어떤 타입이든 뒤에 ? 를 붙여줄 수 있다.fun strLenSafe(s: String?) = … 6.1.2.. 2017. 8. 18.
[android] design support library [android] design support library https://android-developers.googleblog.com/2015/05/android-design-support-library.html -android design support library 를 통해서 navigation drawer view, floating labels for editing text, floating action button, snackbar, tabs, motion & scroll framework 등을 2.1 이상 버전에서 사용 가능하다. -gradle 에 아래를 추가하자! compile 'com.android.support:design:22.2.0' 이 녀석은 Support v4 와 AppCompat .. 2017. 8. 4.
반응형