0

The OS_OBJECT_USE_OBJC flag denotes that GrandCentralDispath queues (and probably other OS objects?) are fully compliant Objective-C objects (so they managed by ARC, etc.)

If I do

#if OS_OBJECT_USE_OBJC
    NSLog(@"OS_OBJECT_USE_OBJC=1")
#else
    NSLog(@"OS_OBJECT_USE_OBJC=0");
#endif

From the AppDelegate I see OS_OBJECT_USE_OBJC=1. However, doing the same within the code of any Pod shows OS_OBJECT_USE_OBJC=0. The first line of my Podfile is

platform :ios, '7.0'

and omitting that line doesn't seem to make a difference. My Base SDK is iOS 8.0 and my Deployment Target is iOS 7.0.

How can I "enable" OS_OBJECT_USE_OBJC for my pods?

Also, is there any official documentation explaining OS_OBJECT_USE_OBJC? I couldn't find any.

ipmcc
  • 29,581
  • 5
  • 84
  • 147
Ricardo Sanchez-Saez
  • 9,466
  • 8
  • 53
  • 92
  • 1
    Care to explain the downvote? I think this is a reasonable question. – Ricardo Sanchez-Saez Oct 13 '14 at 12:46
  • Have you tried specifying `deployment_target`? In the Cocoapods documentation, all discussion of `OS_OBJECT_USE_OBJC` is associated with the `deployment_target` settings, not the `platform` settings. – Rob Oct 13 '14 at 14:16
  • I think `deployment_target` is only used within Podspecs and cannot be used in a Podfile. Incidentally, my pod project targets' have 7.0 as the `Deployment target`. I think there must be an additional setting around the build settings that is opting out of GDC ObjC objects. – Ricardo Sanchez-Saez Oct 13 '14 at 14:35
  • Reported this a Cocoapods bug [here](https://github.com/CocoaPods/CocoaPods/issues/2659). – Ricardo Sanchez-Saez Oct 13 '14 at 15:40
  • Me too. Why the downvote? – coco Dec 04 '14 at 18:12

1 Answers1

1

Pods that specify a deployment target of < iOS 6.0 or OS X < 10.8 on their .podspec file, will have OS_OBJECT_USE_OBJC = 0 regardless of the Deployment Targetset on app using the pod.

See here and here for more info.

Ricardo Sanchez-Saez
  • 9,466
  • 8
  • 53
  • 92
  • Unfortunately for me, this is set to 0 even for pods whose specs have a deployment target set at iOS 6.0 or higher. This appears to have happened to all my pods. – Beltalowda Feb 16 '16 at 23:26