making xib file show on app launch

Discussion in 'Mac Programming' started by porridge111, Aug 11, 2008.

  1. porridge111 macrumors newbie

    Joined:
    Aug 11, 2008
    #1
    I have this xib file and I would want it to show when my application opens. inside of interface builder I told the window to show at launch, but it still doesn't… all it wants to show at launch is mainmenu.nib. Is there a way to make other files show on app launch.

    also, I would like the xib file (or window inside it…) to be opened with Cmnd N.

    btw. this is a web browser that I'm trying to make, so multiple windows is kinda a must…

    I know nothing about programming, so sorry if this is really something simple that I should be able to figure out myself…
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Have you loaded the nib (xib files get turned into nib files when you compile your program) file in your code and displayed it?
     
  3. porridge111 thread starter macrumors newbie

    Joined:
    Aug 11, 2008
    #3
    not sure what you mean…

    loaded into code? where, on what file. I have just added two xib files to my project.
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    Ah well, you need to write the code to display the relevant files. Making an app is not drag and drop, you actually do need to do some programming :).

    A good place to start if you have no programming experience at all is to read this.

    Edit : You should also read this (in fact you should read this first, then read the other document).
     
  5. porridge111 thread starter macrumors newbie

    Joined:
    Aug 11, 2008
    #5
    ok, i'll read that. The default mainMenu.NIB shows up without programming, so I was hoping for a way to make an xib I had added do the same, but I guess it's not that simple…
     
  6. porridge111 thread starter macrumors newbie

    Joined:
    Aug 11, 2008
    #6
    waaait, to I ad a second file that tells the program to display the xib, or do I write the xib class files, and ad code to those that make them display?
     
  7. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #7
    Have you tried to link views together from one xib file to the other? Basically the way Cocoa works is that it loads xib files dynamically as they are needed. The reason the current xib file loads is that the project sets it as the default xib file by default, the rest you need to do yourself.
     
  8. sapplesystems macrumors newbie

    Joined:
    Nov 26, 2009
    #8
    Hi All,

    I am new to Iphone programming. So please don't mind if I ask some basic questions. :mad:

    I want to develop an application where the landing screen will be a login screen and after login application should display a new screen with the list of available categories. And on selecting any category a new screen should appear with the information related to the selected category.

    Basically I want to display different screens in the applications and my confusion is how can I make different screens with one .xib file? or should I use different .xib files for each screen. If I use different .xib files for each screen then how should I navigate to different screens.

    Please help in solving this confusion.


    Thanks in advance

    Gaurav
     
  9. petron macrumors member

    Joined:
    May 22, 2009
    Location:
    Malmo, Sweden
    #9
    Hi Gaurav

    I will try to answer some of the questions.

    Yes you have to have several XIB files, each for each window.

    In my designs I needed several windows at the same time, started form the main application. I used the NSWindow.

    In case of Iphone I think you have only one NSWindow, but you can have several Panels/Sheets. It works the same way but the Sheet/panels need to be of modal type.

    The approach would be to:
    1. Start from the main application
    2. The First thing the main application is doing is to start a Modal NSPanel sheet that picks up the Login info.
    3. Login terminates and return controll to Main App
    4. Main app start the category screen
    5. Do the job in the category screen and return into the Main App.

    I hope it will give you a hint to dig more about the case.

    /petron
     

Share This Page