Using Xcode 3.1 to build a Universal Binary... ?

Hello,

I’m having a hard time configuring Xcode 3.1 so that it builds an ASS application that works on both PPC and Intel Macs.
Is that even possible ? I’ve been looking at Apple’s documentation, namely THIS but it just confuses the hell out of me (plus it’s for Xcode 2) !

Can anyone help ? Thanks in advance …

Hi,

actually it’s sufficient to disable “Build Active Architecture Only” in the Info > Build or the project

Hi StefanK,

Someone tried my app on a PPC based mac, and it didnt even open.

What you said is what I did, apparently thats not enough … Im still looking at apple’s docs

Right, someone just tried it on an Intel-based mac, but under 10.4 and it just doesnt work either.
Im not sure what to do, I messed around with the build settings and tried different things though …

Have you selected
Base SDK: Mac OS X 10.4 ?

YES

Done everything by the book :slight_smile:

F them if it doesnt work, i’ve busted my ass enough on this app… and its not over – still having problems with freakin sparkle framework

I had the same problem. If you create a new project on Leopard, ImageBuilder doesn’t create a nib but a 3.1 version (forgot the name). This uses functionality not available in the Appledefkits on 10.4.
I had to take my applescripts to 10.4, make a new project in XCode 2.5 complete with “old format” nib. This project could be copied back to Leopard and further modified.
Note: You can modify existing panels and windows as much as you like in Leopard. However, as soon as you make a new panel or window the whole nib is again “automatically upgraded/uplifted” to the a higher format nib, not available on tiger either (I ran into than one too).
A few empty panels/windows hardly influence the size of your project or application. Once your completely done you can easily remove them (or not)

My way of working right now is:
(Initially: reinstalled my “old” tiger to an external usb disk and boot from that one and install XCode 2.5)

  • Create new project including windows and panels (and make two or three windows/panels in advance) on Tiger.
  • Take it back to Leopard (working in XCode 2.4 compatible mode)
  • Develop, compile and build everything.
  • If I need a new panel or window (not being one of the “spare” empty windows/panels I had), I go back to Tiger and define the new window/panel there. Go back into Leopard and finish everything there.

I think Apple did a worthless, stinking job. You can specifiy a “2.4 compatible” project in XCode 3.x, but the accompanying Interface Builder part is not set to that level: therefore, all your developed applescripts don’t run any longer on 10.4 (be it intel or ppc)

And even that is not true (set Note to false ;))
You can modify existing items on a panel or window. However if you want to add a new item like a new text field, Interface builder (under XCode 3.x.y) complains that it can’t save it in the current format.

I had this in my last App with a panel and a window with two extra text fields, a drop down and a matrix, all unallocated. That works, but as soon as you add something new (see above), you are in trouble again.
My way of working right now (as of yesterday evening) is:
(Initially: reinstalled my “old” tiger to an external usb disk and boot from that one and install XCode 2.5)

  • Create new project including windows and panels (and make two or three windows/panels in advance) on Tiger.
  • Take it back to Leopard (working in XCode 2.4 compatible mode)
  • Develop, compile and build everything.
  • If I need a new panel or window or a new item on an existing panel or window, I go back to Tiger and define the new window/panel there. Go back into Leopard and finish everything there.

Confirmed again!

(And still I like Applescript very much :D)

A happy and healthy 2009 to everyone!

Hi,

Thanks for this precious info.
Unfortunately I dont have a Tiger installation CD (and even then, I really dont think I would bother going back and forth between the 2 OS for a free application!).

I’m not going to promote my app here, it’s out of place (even though I’m really proud of it, being my first and only one so far! besides I’m sure there are thousands of them just like it out there – maybe not free but still!), but one of my users on a 10.4 / PPC Mac is getting an error related to a command line I have in my script :

Here is the line in my app:

do shell script "xattr -d com.apple.quarantine " & (thisItemPos as text)

I use it to unquarantine files downloaded from the internet, because it sometimes keeps the files from beign processed by my app (you know that painful message,

well try working with a text file from the net (with a droplet for example) if you havent previously opened that file, you’re in for a major disappointment :wink: ).
So, I found a workaround online (HERE) and used it in my app.
I’m guessing that line isn’t valid on PPC or 10.4 or something?


set Note to true (:))

I think you are right, Apple did a worthless job regarding the compatibility of old and new systems – even regarding the development material, as you mentioned it… also, the documentation isn’t that good, and not accessible to newbie programmers. None of it is localized in other languages, which also really sucks.
but I’m only saying that from the little experience that I have in programming, and because I want to become a good programmer some day, so what do I know :slight_smile:

I don’t think so at all.
The compatibility issues are described in the release notes of the appropriate programming languages.
New introduced functions cannot be compatible with the former system version, this is technically impossible
If you’re going to use a function which is available in Leopard but not in Tiger, then you, the programmer, has to take care of the
proper functionality of your program as you are responsible to catch all user errors to prevent the program to crash.

I include a system version check in all my programs.
If the system version is less than the required one, the program displays a message and quits.
Retrieving the current system version allows you also to use different code for the different versions if necessary.

It’s a wise thing to do indeed, but to be honest I can’t be bothered to do that.

I, as a programmer who wants to develop something that is compatible with older systems, should not have to spend time doing that, right ?
You have no idea what I had to go through for my app to be compatible with 10.4 (esp having no way to test it myself), and yet it all seems so simple when you read apple’s doc, like all you have to do is click a button or two in the build settings!
From my own experience at least, that is BULLSH**!

All I’m saying is apple should have thought about it instead of putting it all on the responsibility of the developper.
Now I’m not experienced enough to really discuss this… it’s only my opinion as a dev-beginner… :wink:

:smiley:

Of course Xcode displays an error message, if there are version incompatibilities with the languages you are programming in
like AppleScript or Objective-C, but this affects only the problems with the vocabulary of the language itself, not e.g. any application terminology.

Your crucial line is a UNIX shell command, which doesn’t belong to AppleScript.
It is not possible in AppleScript Studio that the compiler considers every functionality change of the UNIX shell, or ruby, perl, mysql etc. etc
because it’s no part of the AppleScript compiler

As such I fully agree with you and so does Apple in the XCode ide itself. That’s why you can set the XCode compatibility to 2.4 to only use 2.4/2.5 (Tiger specific) fnctionality.
So, I did set the compatibility to 2.4. Next I want to use a 1.2 version NIB. This can’t be set/created from XCode 3.1 (at least not that I can find from documentation, developer.apple.com or anywhere “in” google). I need to create a version 1.2 NIB on Tiger.
Existing Interface Builder objects, (created under Tiger!!) can be changed in Leopard. However, it is not possible to create new objects on existing 1.2 version NIB objects as new Interface Builder objects are set to a higher incompatible version. This is plain stupid behaviour and prevents fully downward compatibility. I think most programmers want to write for both Tiger and Leopard. If I write C++ combined with WxWidgets or Qt for example (which I occasionally do for two open source packages) I can interchange between Tiger and Leopard. With Apples own applescript I can’t.
Interface Builder can change and (automatically) “save as” to old version, but it can’t create on existing objects and than (automatically) “save as”.
IMO: badly written software, be it only in one small corner.
(and I’m certainly not stating that I can do it better, not at all)

If someone can proof I’m wrong, please, please do so. I would be very happy to know how to accomplish this in Leopard.
(One option I didn’t try yet is to install XCode 2.5 on Leopard, next to 3.x, and try that combination, which would mean that I can develop totally on Leopard and also be able to use it on Tiger)

Well, I installed XCode 2.5 next to 3.1 on Leopard. In 2.5 I build “MacOSX 10.2 and later” nibs that are downward compatible in Tiger.
As I develop for both Tiger and Leopard I will make my Applescript Studio applications from this time on completely in XCode 2.5 on Leopard.
The Open source projects I support for MacOsx work fine from XCode 3.x: one using WxWidgets, the other using Qt.

Another thing to pay attention to is the option in Preferences->“Text Editing”. XCode 3.1.2 defaults to line ending “Mac CR” and file format UTF-8 whereas XCode 2.5 defaults to Unix LF and “System Default”. At least that’s how it’s defaultly installed on my system. If you don’t pay attention to this setting, your applescript files may not be inter changeable.

Okay I haven’t read thru everything here, but I will offer my experience in the hope that it helps someone.

I started a AppleScript Studio project on my intel MacBook Pro running 10.5.6 with Xcode 3.1

I ran into the initial problem of the application not running on Tiger machines. Here are the ONLY things I did to the project to make it work.

In the Project Build Info page I ensured, as Stefan said, that “Build Active Architecture Only” is UNSELECTED. (Base SDK still says Mac OS X 10.5 and Deployment Target says the same.). The only other thing I did was in the main project window change the active SDK to 10.4.

With that change made I built the project and have successfully ran it on

Intel w/ Leopard
Intel w/ Tiger
PPC w/ Leopard
PPC w/ Tiger

(My nib file is a .xib fwiw)

Hi James,

thanks for your feedback.

With regard to the settings: That’s indeed what I also always specify. Both for applescript as well as as C++ projects incl. Qt and WxWindows where it does work (not using Interface Builder that is). Next to that I always specify universal 32 bit and sometimes 32/64bit with specific optimization in case a 4architecture build has preference (64bit speed optimization on G5 for example).

Note: I’m not a C/C++ programmer (not after '93 that is) and daily improving on my still limited applescript skills. I’m an experienced compiler after many years (both by hobby as for work) on lots of Linuxes, *BSD’s, AIX and so on and that’s where my contribution to OS projects lies.
As mentioned earlier: I appreciate every help that makes it possible to using only one XCode (3.1) for building for both Tiger and Leopard.

With regard to the objects on the panels/windows: Do they contain combined views, e.g.

  • scroll views containing text views
  • scroll views containing table views
  • scroll views containing table views containing image cells
    I can’t test right now, but either simple push buttons OR simple text fields can’t be added either.
    For me, these are the objects/elements, when added to the Interface builder in 3.1, with above mentioned settings, never work on Tiger.