This is probably a dumb question, but I’m new to programming and was wondering what ppl typically do.
Typically I use separate .h and .m files for all my classes.
I have a small class that just has a few properties on it that is a subclass of NSObject.
I use this class just to populate a UITableView. I see that when I put it all in one of the related .m files, no one can see it unless I include the .m which I don’t want to do because of a circular reference. So do I just put it in the .h file? Or do ppl always put it in separate .h and .m file for each class? Thanks.
This is probably a dumb question, but I’m new to programming and was wondering
Share
Just put in the .h file, unless you want the class to be private ( or certain parts of it ). A good way of hiding stuff from other classes is by defining a category inside the .m file.