Skip to content

Applying -DOS_OBJECT_USE_OBJC=0 doesn't take into account developer integrations #1001

Closed
@keith

Description

Right now cocoapods applies the -DOS_OBJECT_USE_OBJC=0 flag to any pod's that are installed with a deployment target under iOS 6.0.

Lets take into account a cocoapod that has a deployment target of iOS 5.0 but has integrated in target conditionals to support iOS 6.0 deployment without warnings/errors on GCD objects:

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_6_0
@property (nonatomic, assign) dispatch_queue_t animationQueue;
@property (nonatomic, assign) dispatch_semaphore_t animationSemaphore;
#else
@property (nonatomic, strong) dispatch_queue_t animationQueue;
@property (nonatomic, strong) dispatch_semaphore_t animationSemaphore;
#endif

Cocoapods will still apply the compiler flag and disable the developers efforts to check and supply this.

The only way I seem to be able to work around this is to remove my developer conditionals integration on the dispatch objects or create a separate podspec for iOS 6.0+

Activity

keith

keith commented on Apr 25, 2013

@keith
MemberAuthor

Moved from and other discussion https://github.com/CocoaPods/Specs/issues/1730

alloy

alloy commented on Apr 25, 2013

@alloy
Member

Unfortunately I don’t see a better way than to add an attribute that allows you to explicitly enable/disable it, while defaulting to the current behaviour.

alloy

alloy commented on Apr 26, 2013

@alloy
Member

FYI, a current workaround would be to have the conditional check the value of OS_OBJECT_USE_OBJC.

/cc @robertjpayne

added a commit that references this issue on Sep 17, 2013
alloy

alloy commented on Dec 6, 2013

@alloy
Member

Did not realise this was still open, my bad. As outlined in https://github.com/CocoaPods/Specs/issues/4323, lib authors should use the OS_OBJECT_USE_OBJC flag instead of doing their own checks. Feature detection is always a better solution over version checking.

added a commit that references this issue on Sep 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    t3:discussionThese are issues that can be non-issues, and encompass best practices, or plans for the future.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Applying -DOS_OBJECT_USE_OBJC=0 doesn't take into account developer integrations · Issue #1001 · CocoaPods/CocoaPods