set the size of the xib

Discussion in 'Mac Programming' started by Binju, Mar 25, 2010.

  1. Binju macrumors member

    Joined:
    Jan 31, 2010
    #1
    I want to set the mainwindow.xib size to the screen size of the system ?

    how to do?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You mean you want to set the size of the window. Not the xib (which is a file) right?
     
  3. Binju thread starter macrumors member

    Joined:
    Jan 31, 2010
    #3
    mainmenu.xib (window)
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    A .xib is a file on your filesystem. It contains serialised objects. The size of an xib is measured in kilobytes. So you cannot set the size of an xib to be the size of your screen.

    An xib can contain one or more seralized windows. These are not the same as the xib and should not be referred to as the xib. I hope the distinction is clear.

    To set the size of a window to the size of the screen you'll need to do it in code (as the screen size on the machine may change between design and run time). Use the NSScreen class to find out the size of the screen and set the size of the window to an appropriate size when you display it.
     

Share This Page