Re: building and running on Snow Leopard
Re: building and running on Snow Leopard
- Subject: Re: building and running on Snow Leopard
- From: Matt Neuburg <email@hidden>
- Date: Wed, 23 Sep 2009 08:32:22 -0700
- Thread-topic: building and running on Snow Leopard
On Wed, 23 Sep 2009 03:39:23 -0700 (PDT), Chris Idou <email@hidden>
said:
>From: Ken Thomases <email@hidden>
>
>>Don't test whether you're running on Leopard.
>
>Well I'm thinking of a particular bug on Leopard with MDItemCreate where you
have to choose between your program crashing and leaking memory.
Yes, Ken's advice doesn't make sense to me here. Certainly there will be
situations where you want to use Gestalt to test what system you're running
on.
I've just started the process of updating my various little Tiger-and-before
apps for Snow Leopard. Dealing with the problem of whether to run on Leopard
too has been tricky. I was hoping that setting my deployment target to 10.5
(and base to 10.6) would mean that on Snow Leopard I would magically crash
if the app was destined to crash on Leopard, but no such luck. :) The only
way is to copy the built app over to a Leopard machine, run it there, see
what happens, and then try to figure out what the heck it means. You can
spend hours puzzling over a single line of code (at least, I can). REALbasic
has "remote debugging", e.g. it lets you build and debug on a Mac while the
app (with all its breakpoints etc.) is running on a Windows machine, so you
can test your cross-platform compatibility; it would be really cool if Xcode
had something like that.
Plus of course in addition to systems there are architectures to take
account of. At a point where everything was fine on Snow Leopard, at the
same time, on Leopard I was crashing on startup in 64-bit, running fine in
32-bit, and running very weirdly in Rosetta. It took a while to get that
sorted out.
In the end I used a combination of Gestalt (what system are we running on?)
and #if __ppc__ (what architecture are we building for?) to tweak the app's
behavior as needed.
Of course you *could* just say "This app is Snow Leopard / Intel / 64-bit
only," and save yourself a lot of work. :)
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
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