본문 바로가기
[Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions [Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions 참조 : Kotlin in action -Java 에는 특정 class 에 결속되어 있는 언어적 기능이 있다.예를 들어 Iterable 를 구현하면 for loop 에서 쓸 수 있고, AutoCloseable 을 구현하면 try-with-resources 에서 사용할 수 있다. Kotlin 도 비슷한 것들이 있다.그러나 specific type 에 결속된 것이 아니라 specific name 에 결속되는 기능들이 있다.예를 들어 plus 라는 이름으로 class 에 function 을 추가하면, + operator 를 해.. 2017. 8. 24.
[Effective Objective-C] #18 가변 객체보다는 불변 객체를 사용하라 [Effective Objective-C] #18 가변 객체보다는 불변 객체를 사용하라 출처 : Effective Objective-C -프로퍼티를 기본 설정으로 두면 읽기 쓰기(read-write) 인데 이는 클래스를 가변적(mutable)로 만든다. -컬렉션이 가변 객체를 저장하고 집합(컬렉션)에 포함된 객체가 변형된다면, 집합의 내부 데이터 구조는 쉽게 불일치(inconsistent) 상태가 될 것이다.객체는 필요할 때만 가변적으로 만드는 것을 추천한다. -불변 객체를 만든다는 것은 프로퍼티를 외부에 읽기 전용으로 만든 다음 필요할 때만 데이터를 노출하는 것을 의미한다. -클래스를 불변으로 만들려면 모든 프로퍼티에 readonly 속성을 추가하면 된다.이제 무엇이든 프로퍼티 값을 변경하려 하면 컴파.. 2017. 8. 21.
[iOS Study] 연락처 프로그래밍 가이드 in iOS - BaseObjects [iOS Study] 연락처 프로그래밍 가이드 in iOS - BaseObjects https://developer.apple.com/library/ios/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/BasicObjects.html#//apple_ref/doc/uid/TP40007744-CH3-SW1 -Address Book database 를 확실히 이용하기 위해서는 4가지 요소를 잘 알아두어야 한다. 1. Address books2. Records3. Single-value properties4. Multi-value properties Address Books -ABAddressBookRef in.. 2017. 6. 19.
반응형