Modify NIB using XCode

Discussion in 'Mac Programming' started by satyam90, Nov 26, 2007.

  1. macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    Hi, I am using XCode 2.4.1 with OBJ - C (Cocoa framework)
    I have created an application with all required NIB's and implemented all its functionality. Its working fine.
    Now my boss asked me to put a Checkbox(NSButton) and implement its functionality in a dialog.

    I know how to do it in a dialog from scratch and create necessary classes (files). Now when I try to add a checkbox, its attributes and actions, all the functionality of the classes(files) will be over written. So, how can I add a new Button to a dialog now.

    Thanks in advance.

    satyam.
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Why would everything else be overwritten? Changing the nib should not be changing code in your class files. Just add the necessary actions to your controller class, drag the .h header back into Interface Builder, and connect the actions. And if you aren't using Cocoa Bindings, you should be; they can typically reduce the code you need to write for such things to near zero.
     
  3. thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #3
    when NIB is ready and classes(files) are created, I am adding my own variables and functions(methods) as per my requirement. Now when I change dialog and create classes(files) again, it is showing message box to overwrite or merge.
     
  4. macrumors 6502a

    Joined:
    Sep 7, 2005
    #4
    Ah, like that.

    Just add the new outlets and actions in code, then re-read the files in Interface Builder (right click the class, then read headers).
     

Share This Page