On Sun, Oct 11, 2009 at 1:55 PM, Ben Haller
<bhcocoa...@sticksoftware.com> wrote:
> On 11-Oct-09, at 4:11 PM, Kyle Sluder wrote:
>
>> On Oct 11, 2009, at 1:06 PM, Ben Haller <bhcocoa...@sticksoftware.com>
>> wrote:
>>
>>> Yes, but my code also needs to compile as GC-unsupported against the 10.4
>>> SDK, where any GC-specific calls that I might need to make will not compile.
>>>  Am I missing something?
>>
>> Do you really need to compile against the 10.4 SDK? Why not compile
>> against the 10.6 SDK with a 10.4 deployment target?
>
>  I frankly don't know.  I'm following the instructions I found telling me
> what build settings would result in a screensaver that would run on 10.4
> through 10.6, ppc and intel:
>
> http://www.eisbox.net/2009/09/01/2402-distributing-a-screen-saver-for-10-4-10-5-and-10-6/
>
>  I saw similar instructions on several other web pages.  I've got my
> screensaver successfully compiling and running for everything except 10.6,
> so I'm loath to go back and mess around with this stuff now.  I presume the
> author had a good reason for specifying the 10.4 SDK and GCC 4.0 for the
> older archs.  Perhaps the 10.6 SDK is not supported for PPC builds, or
> something?  I have no idea.  I'm very new to all this (I've been away from
> Cocoa programming for about five years), and I'm finding the learning curve
> to be a bit steep.
>
>> If you don't need the NS/CFMakeCollectable or other GC-specific functions
>> (which most usually don't) then it's a moot point.
>
>  Well, I imagine I'm going to need to use *something* GC-specific --
> strong/weak declarations,

Not likely.

>  finalize methods, whatever.

Implementing finalize methods are actually quite rare; and even if you
do implement them, that won't prevent building for/running on 10.4.

> At present my
> screensaver crashes on 10.6 when compiled with GC-supported set.  That is
> presumably because some object is getting collected prematurely.

Yes, that is likely the case.

>  I'll need
> to make some change to the code to fix that, and that change may not be
> compatible with the non-GC builds,

It's exceedingly unlike that whatever change you need to make will
render the code incompatible with 10.4.

> since it will use APIs or Objective-C 2.0
> syntax that is not available when building for 10.4 PPC.  This is a large
> project (for a screensaver), with many classes, and runs multithreaded.  The
> idea that I can make it compile both GC-unsupported and GC-supported without
> a single #if seems unlikely.

Xcode itself is a large project, with many classes, and runs
multithreaded, and builds both GC-supported and -unsupported. There
are no #ifdefs involved.

> I may well be completely misunderstanding
> something; but having read through the Garbage Collection Programming Guide
> several times now, I don't see any particular reason to think that I won't
> need GC-specific calls.  They certainly give lots of examples of cases in
> which one does.
>
>  Sorry if I'm just being clueless, but I'm trying hard to get a clue.  :->

Perfectly understandable. I'm just trying to assure you that the cases
in which you actually have to call GC-specific API is quite small, and
are usually relegated to edge-cases.

-- 
Clark S. Cox III
clarkc...@gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to