매 년의 보관소: 2012

C++ Dynamic library (Mac OS X)

동적 라이브러리가 로드될 때 언로드 될 때 스스로 초기화 해야 할 필요가 있을 때 다음과 같이 작성한다. __attribute__((constructor)) static void initializer1() { printf(“[%s] [%s]\n”, FILE, FUNCTION); } __attribute__((destructor)) static void finalizer1() { printf(“[%s] [%s]\n”, FILE, FUNCTION); } 여러 개의 constructor나

도큐멘트 에 올린 글

Amazing features in Xcode 4.4(LLVM Compiler 4.0)

Amazing features in Xcode 4.4(LLVM Compiler 4.0)   Xcode가 4.4로 업데이트 되면서 LLVM Compiler도 4.0으로 업데이트 되었다.   여기에 재밌는 기능이 추가 되었다.   1. Objective-C @synthesize command is generated by default when using properties. 2. Objective-C adds literal syntax

도큐멘트 에 올린 글

Category를 사용한 Objective-C 정적 라이브러리

캐러고리(Category)로 아브젝트(Object)를 확장한 코드를 스태딕 라이브레리(Static library)로 빌드하여 링크한 것을 가져다 쓰는 실재 인스턴스(Instance)는 실렉터(Selector)를 찾지 못하는 런타임 익셉션(Runtime exception)을 만나게 된다. 이런 ‘Selector not recognized’ exception의 해결 방법으로 Apple Inc.는 Other Linker Flags에 -ObjC 옵션을 주고 프로젝트를 다시 빌드하라고 한다.

도큐멘트 에 올린 글