개발일기/IOS
[Xcode] - static Library
코딩하는빵친자
2024. 6. 25. 15:30
- static library 정리
https://zeddios.tistory.com/1308
(Static/Dynamic) Library
안녕하세요 :) Zedd입니다. ~ 애플 문서를 보던 중 ~ Overview of Dynamic Libraries Overview of Dynamic Libraries Two important factors that determine the performance of apps are their launch times and their memory footprints. Reducing the size
zeddios.tistory.com
- staticlibrary로 나온 .a 파일과 헤더파일 → 헤더파일이 해당이름의 .a파일을 가르키고있기 때문에 .a파일의 이름을 바꾸게 되면 찾지못하고 에러가 뜨게된다.따라서 이를 구분해주기 위해 build setting에서 library search path를 지정해주어야한다. 만약 디버깅을 할 때 시뮬레이터, 디바이스용을 구분하고 싶다면 Debug안에 분기하여 path를 알맞게 적어주면 된다.
- 잊지말아야할 것은 build phases의 library link에 꼭 library.a를 넣어주어야 링크가 된다는 것!
- 따라서 시뮬레이터용과 디바이스용 static library가 같은 이름으로 되어있으면, xcode의 타겟의 General에서 frameworks, library…에 추가가 하나의 이름으로 된다. 왜냐하면 xcode는 같은 이름의 라이브러리 등의 파일을 동일시하다고 여기기 때문이다.
728x90