2014-12-03 3 views
2

iOS 5.x/OS X 10.7 배포 대상으로 빌드 할 수있는 라이브러리 또는 더 최신 라이브러리에서 dispatch_queue_t 속성을 올바르게 정의하는 데 문제가있었습니다. here을 제안 내가 그것을 해결할 수있는 대부분의 경우CocoaPods 라이브러리에서 강력한 dispatch_queue_t

:

프로젝트에 직접 파일을 포함 할 때 수동으로 정적 라이브러리를 생성하거나이 작동
#if OS_OBJECT_HAVE_OBJC_SUPPORT // == 1 not really needed 
@property (nonatomic, strong) dispatch_queue_t loggerQueue; // An Objective-C object 
#else 
@property (nonatomic, assign) dispatch_queue_t loggerQueue; // A C pointer 
#endif 

.

이 코드는 CocoaPods 라이브러리에 추가되지만 iOS 6 +/OS X 10.8+ 배포 대상에서는 중단됩니다. CocoaPods가 배포 대상을 올바르게 설정하고 컴파일러가 OS_OBJECT_HAVE_OBJC_SUPPORT == 1 집합을 설정하고 strong 정의를 선택합니다. 나는 그러나 아이폰 OS 5.x를/OS X 10.7 오류 얻을 :

Property with 'retain (or strong)' attribute must be of object type

내가 CocoaPods과 정적 라이브러리하지만 의심스러운 아무것도의 결과로 환경 변수를 비교했습니다. 나이 CocoaPods 같은

#if OS_OBJECT_HAVE_OBJC_SUPPORT && !defined(COCOAPODS) 
@property (nonatomic, strong) dispatch_queue_t loggerQueue; // Always disabled 
#else 
@property (nonatomic, assign) dispatch_queue_t loggerQueue; 
#endif 

답변

2

SeemsOS_OBJECT_HAVE_OBJC_SUPPORT을 깨는 OS_OBJECT_USE_OBJC을 다시 정의했다 : CocoaPods으로 구축 할 때

는 지금 내가 전부 strong 정의를 해제하여 패치있다.

우리는 OS_OBJECT_USE_OBJC을 확인하고 최신 CocoaPods를 사용하여 fixed을 얻었습니다.