Develop
2014.08.08 11:18
[ios] 카테고리 확장 메소드를 찾지 못하는 경우
조회 수 1995 댓글 0
첨부 '1' |
|
---|
카테고리(Category) 확장 메소드를 못찾는 경우
오픈 소스나 3rd party 프레임워크를 가지고 왔는데, 빌드시 오류도 없고 소스도 잘 가지고 있는 카테고리의 경우 실제 실행시 해당 확장한 카테고리의 메소드를 못 찾는 경우가 있다.
해결방법은,
TARGETS > 앱명 > Build Settings > Linking “Other Linker Flags” 에 “-ObjC” 추가해 준다.
(ex)
xxx.m에서 사용한 #import "NSMutableArray+aaa.h”의 객체 queue가 있는 경우, 얘의 메소드 enqueue를 못 찾고 죽는경우
<오류스타일>
2014-04-15 19:28:23.093 BookPlayer[3352:60b] -[__NSArrayM enqueue:]: unrecognized selector sent to instance 0x17d46270
2014-04-15 19:28:23.098 BookPlayer[3352:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM enqueue:]: unrecognized selector sent to instance 0x17d46270'
*** First throw call stack:
(0x2ead4fd3 0x39281ccf 0x2ead8967 0x2ead7253 0x2ea267f8 0x84831 0x80fb1 0x7eeb7 0x31326057 0x31325ff7 0x31325fd1 0x31311737 0x31325a4f 0x31325721 0x313206eb 0x312f58ed 0x312f3f97 0x2eaa025b 0x2ea9f72b 0x2ea9df1f 0x2ea08f4f 0x2ea08d33 0x3390d663 0x3135416d 0x740c5 0x3978eab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
[참고] http://stackoverflow.com/questions/10442653/unrecognized-selector-calling-category-method-in-static-ios-library
Your 3rd party framework is probable using a category on a existing (apple) class. But to load/find the category you need to add the -ObjC flag in the build settings under Other Linker Flags
[출처] http://funnyrella.blogspot.kr/2014/04/104.html
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
697 | Develop | [ios] 앱의 로컬 js 파일에서 해당 프로젝트의 이미지 불러오기 | hooni | 2015.02.10 | 627 |
696 | Develop | [ios] 문자열로 함수 실행하기 (eval 함수처럼) | hooni | 2015.02.10 | 853 |
695 | Develop | [ios] URL 랜딩 속도(OpenURL 10초 정지되는) 이슈 | hooni | 2015.02.09 | 851 |
694 | Develop | [js] 2048 예쁘게 만들고 있는거.. ㅋㄷ | hooni | 2015.01.30 | 0 |
693 | Develop | [php] XE 스킨에서 특정 도메인 리다이렉션 | hooni | 2015.01.28 | 577 |
692 | Develop | [php] XE에서 도메인 별로 광고 다르게 적용하기 | hooni | 2015.01.28 | 616 |
691 | Develop | [maven] Mac OS에 메이븐(maven) 설치하기 | hooni | 2015.01.21 | 1108 |
690 | Develop | [ios] iOS 앱 아이콘을 만드는 유틸 | hooni | 2015.01.03 | 871 |
689 | Develop | [ios] Xcode의 디버그 모드에서 콜스택 | hooni | 2015.01.03 | 1002 |
688 | Develop | [ios] binary를 C코드로 변환 | hooni | 2015.01.03 | 1529 |
687 | Develop | [ios] APNS에 사용할 인증서 만들기 (KeyChain에 있는 인증서 Export) | hooni | 2015.01.03 | 894 |
686 | Develop | [ios] iOS앱의 Xcode 빌드 과정 | hooni | 2015.01.03 | 2278 |