PDA

View Full Version : writing universal program




Nishad
Mar 25, 2008, 05:45 AM
Hi all,

i am using a mac mini (intel based - mac os x Tiger) and developing an application which want to read files and working on this using cocoa - objective c in Xcode.

i want to run this application on both intel based machine and power PC.


can anybody tell how can i achieve this . if u can tell some functions that is good.

With regards
Nishad.



kainjow
Mar 25, 2008, 07:10 AM
I believe in Xcode 3.0 and above, all new projects are set to build as universal binaries by default. But if you're running an older version you will need to Get Info on the target, go to the Build tab and there should be an architectures property you can change to include PPC.

Sayer
Mar 25, 2008, 09:22 AM
Also depending on what types of files you want to read/write you could have no problems, or run into the Big/Little Endian issues.

There are many file formats already supported on OSX in Cocoa frameworks (and QuickTime). Images, movies, text (RTF, XML, HTML, various scripting formats).

You can also transparently save arbitrary objects to and read them from disk-based files using the Archiving features of Cocoa.

If you want to test the PowerPC-based version of your program you can run it in the PowerPC translator in OS X called Rosetta. Just Get Info (Command-I) the app in the Finder and check the box that says "Open using Rosetta."