Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
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.
 

HiRez

macrumors 603
Jan 6, 2004
6,250
2,576
Western US
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.
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.
 

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
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.
 

Sijmen

macrumors 6502a
Sep 7, 2005
709
1
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.

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).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.