PDA

View Full Version : Using "Create Class Files" in IB




theagentx
May 10, 2009, 03:59 PM
Just a quick question:-) If this is too stupid, let me know....

Let's say I have created a simple TableView in IB for an iPhone application created off of the Windowed Application template in Xcode...

I have a table View with a tool bar at the top and a "Done" button in it.

In IB there is a feature "Create Class Files"

Lets say I use this and it will create class file in Xcode for: on for the button, one for the tool bar, one for the Table...etc...

Is this good practice to do this?
Is it bad practice?
Should they be in separate classes?



BlackWolf
May 10, 2009, 04:34 PM
well, I don't see a reason why, for example, you would need to subclass the button. and if you don't subclass it you don't need a class file for it. if you DO subclass it for some reason, I would create a .m and .h file for that button. putting multiple classes in one file gets pretty confusing

PhoneyDeveloper
May 10, 2009, 08:46 PM
I always work in the other direction. I create files and add outlets, actions, properties in Xcode. I obviously edit the UI in IB.

I think you'll be happier going from Xcode to IB for textual things.