0

I have some model classes that contain only @property declarations in the header file, therefore my .m implementation files are empty.

So my question is: are these .m files required if I have only @property declarations?

Zoltan Ersek
  • 755
  • 9
  • 28

1 Answers1

2

Yes, it is still required. The part that says:

@implementation MyClass
@end

is actually the most important part of a definition of a class. The header serves only as a forward declaration and doesn't have any functionality on its own.

To understand this well, some knowledge of the C language and its history is required, so I won't go into details. You can get some info from the answers here: Why have header files and .cpp files in C++?

Community
  • 1
  • 1
Sulthan
  • 128,090
  • 22
  • 218
  • 270