The NSManagedObject subclass property are created in its category file, which is very wired since category can only have method. The details are as below:
(1).I have created an entity called BibleAudio in .xcdatamodeld file with several attributes as below.
(2). the xcode generated objective c files are "BibleAudio + CoreDataProperties.h", "BibleAudio + CoreDataProperties.m" and "BibleAudio.h", "BibleAudio.m" as following:
(3). within "BibleAudio + CoreDataProperties.h", BibleAudio's attributes are declared as property here (see following); while in "BibleAudio.h", it is empty. As far as I know, "BibleAudio + CoreDataProperties.h" is a category file and only method can be declared here. Thus the right way in my opinion is declare property in "BibleAudio.h", and if you want add method for this NSManagedObject subclass, you should use a category to add that method.
BibleAudio + CoreDataProperties.h
BibleAudio.h
Does anybody know if my understanding was right? or if I was wrong, what is the logical behind that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…