writing universal program

Discussion in 'Mac Programming' started by Nishad, Mar 25, 2008.

  1. Nishad macrumors newbie

    Aug 2, 2007
    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
  2. kainjow Moderator emeritus


    Jun 15, 2000
    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.
  3. Sayer macrumors 6502a


    Jan 4, 2002
    Austin, TX
    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."

Share This Page