Re: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()
Re: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()
- Subject: Re: OS_OBJECT_USE_OBJC_RETAIN_RELEASE and xpc_release()
- From: Quincey Morris <email@hidden>
- Date: Mon, 05 Nov 2012 10:23:28 -0800
On Nov 3, 2012, at 12:55 , Jerry Krinock <email@hidden> wrote:
> I want to absorb it into a big old project that contains a couple dozen targets. So I added a target for it, with ARC. But building the big project fails because the macro OS_OBJECT_USE_OBJC_RETAIN_RELEASE is defined, and in xpc.h this redefines xpcrelease, which is also apparently a macro, to be a function which invokes -release, which is not allowed under ARC.
What does "building the big project fails" mean? Are you saying it fails to build the target you added, or that the older targets no longer build?
> All of the other targets in the big project do not use ARC. Both targets are built with the "Latest" (10.8) SDK.
So it sounds like one of two things happened. Either a build setting got changed at the project level that was then inherited into all the old target build settings and messed up those builds, or the new target is inheriting a build setting (or the absence of a setting) from the project that it needs to be set differently.
Frankly, if you're not using ARC in the project generally (and don't want to convert the whole project to ARC for practical reasons), you're probably better off just adding manual retain/release code (including xpc_release) back into the tool code. Having subtly different setting distributed around the targets seems like a future maintenance headache. Well, it's already a *current* maintenance headache, really, or you wouldn't be asking about it. :)
Alternatively, package the tool code as a static library or framework, so that it can continue to live in its own project with its own settings.
On Nov 5, 2012, at 09:56 , Jerry Krinock <email@hidden> wrote:
> But I don't fully understand what the effect is. Also, my little project does not have that flag, neither as an option in the relevant source file, nor anywhere in Build Settings. It builds fine without it.
Yes, but the little project does have ARC.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden