newbie resource question

  • Hi,

    I'm a recycled newbie learning Cocoa, using Xcode 4.2.

    I have an old Carbon/command line/OpenGL app that I am trying to convert
    into a Cocoa/semi-command line/OpenGL app.  I'm using the GLFullScreen
    sample code, and am trying to start by tweaking the project and copying in
    the non-code bits first.  (I realize the code will have to be done all at
    once, but I'm not at that point yet.)

    My problem is MainMenu.xib.  I've copied it into my project's Resource
    directory, tweaked it a bit, added a "Copy Bundle Resources" Build Phase,
    and dragged it into there, but it isn't getting copied (I can't see it in
    my application's bundle).

    Xcode 3 had a way to see what was happening during a build, but I can't
    find the equivalent in xcode 4 in either the menus, help, or
    documentation.  Can someone point me to which bit of documentation
    discusses copying of resources?

    Thanks.

    ------------------------------------------------------------------
    Jeff Ray M/S 4840A              Official Correspondence Only:
    NASA                                            <jeff.ray...>
    Dryden Flight Research Center              <Jeffrey.R.Ray...>
    P. O. Box 273
    Edwards, CA 93523-0273          All Others:        <jeffray...>
    (661) 276-3754
  • On 6 Jun 2013, at 3:29 PM, "Ray, Jeffrey R. {Jeff} (DFRC-ME)" <jeff.ray...> wrote:

    > I have an old Carbon/command line/OpenGL app that I am trying to convert
    > into a Cocoa/semi-command line/OpenGL app.  I'm using the GLFullScreen
    > sample code, and am trying to start by tweaking the project and copying in
    > the non-code bits first.  (I realize the code will have to be done all at
    > once, but I'm not at that point yet.)

    I'm not sure what you mean by "semi-command line." Graphical-UI Mac applications rarely pay attention to the command line.

    > My problem is MainMenu.xib.  I've copied it into my project's Resource
    > directory, tweaked it a bit, added a "Copy Bundle Resources" Build Phase,
    > and dragged it into there, but it isn't getting copied (I can't see it in
    > my application's bundle).

    (Just to cover the trivial cases, do you see MainMenu.nib in Contents/Resources/en.lproj (or English.lproj) in your app bundle? That's it.

    (Now for my usual suppositious screed.)

    I don't understand. I downloaded the GLFullScreen example from <https://developer.apple.com/library/mac/#samplecode/GLFullScreen>. Its MainMenu.xib was present and correctly placed. No need to copy it around. I had to let it update the SDK selection, but once that was done, it built and ran with no problem.

    Are you starting with some sort of raw project directory of your own, and trying to build an application project up in it from spare parts? That's possible, but it's easier if you accept Xcode's help.

    For one thing, the Xcode build system works backwards from the product type (as well as forwards from the source types) to work out how to structure the product and how to treat the inputs. It's possible to wrench any kind of Xcode project into any other, but the easiest way is to start with a new project targeted at the kind of product you want, and work with that.

    Make a new project, OS X > Cocoa application. MainMenu.xib will be present and the build system will know what to do with it.

    > Xcode 3 had a way to see what was happening during a build, but I can't
    > find the equivalent in xcode 4 in either the menus, help, or
    > documentation.  Can someone point me to which bit of documentation
    > discusses copying of resources?

    Seeing what is happening:

    The view on the left side of the project window is the Navigator. The last tab is the Log navigator, containing items for each major event in the project's life. Select a build item, and find a summary of the log in the editor view. ("Recent" for the results of the last run, "All" for the cumulative status of each compiland.) Select any summary line and click the lines-of-text button on the right end of the line to expand it to the log listing for that item. The Editor menu, and right-clicking in the listing, give you more options.

    — F

    --
    Fritz Anderson
    Xcode 4 Unleashed: 4.5 supplement for free!
    http://www.informit.com/store/xcode-4-unleashed-9780672333279
  • Subject: Re: newbie resource question

    > On 6 Jun 2013, at 3:29 PM, "Ray, Jeffrey R. {Jeff} (DFRC-ME)"
    > <jeff.ray...>  wrote:
    >
    >> I have an old Carbon/command line/OpenGL app that I am trying to convert
    >> into a Cocoa/semi-command line/OpenGL app.  I'm using the GLFullScreen
    >> sample code, and am trying to start by tweaking the project and copying
    >> in
    >> the non-code bits first.  (I realize the code will have to be done all
    >> at
    >> once, but I'm not at that point yet.)
    >
    > I'm not sure what you mean by "semi-command line." Graphical-UI Mac
    > applications rarely pay attention to the command line.

    It's a command line tool (or rather, launches from the command line), but
    it creates either a window or goes fullscreen.  (It's the 3D
    out-the-window-visuals tool for our flight simulators, if that helps
    explain it.)  It relies on parsing argv/argc, but as long as I'm doing the
    work to get it off Carbon and AGL I thought I'd try to make it possible to
    double click a config file or (just the app).  That's for later, but I
    don't want to do anything in the journey to Cocoa that would preclude that.

    > Are you starting with some sort of raw project directory of your own, and
    > trying to build an application project up in it from spare parts? That's
    > possible, but it's easier if you accept Xcode's help.

    Almost.  I've got my existing Carbon/AGL tool, which has been working
    dandy with Xcode 3 for years.  With what little I've learned about Cocoa
    so far, I figured I could start with my working app and try to merge in
    working Cocoa code (eg, merging the critical bits of GLFullScreen into my
    project), OR I could start with the working GLFullScreen and try to merge
    my code into that, OR I could create a new Cocoa target and try to merge
    parts of my app and parts of GLFullScreen into that simultaneously.

    I'm in for a wrench, as you say, whichever way I go.  I gave the first
    path a try, as my app is much larger than GLFullScreen, but got stuck on
    the resource thingy.  I don't see a way to merge the GLFullScreen target
    into my existing project, so I guess I'll give the third path a try next
    (which is essentially what you suggested).

    Anyway, thanks for the response!

    -j

    ------------------------------------------------------------------
    Jeff Ray M/S 4840A              Official Correspondence Only:
    NASA                                            <jeff.ray...>
    Dryden Flight Research Center              <Jeffrey.R.Ray...>
    P. O. Box 273
    Edwards, CA 93523-0273          All Others:        <jeffray...>
    (661) 276-3754
previous month june 2013 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today