I created a new project with objective-c using coredata as so many times before, but I noticed the newer Xcode is not allowing me to debug the properties on my NSManagedObject which refer to another different NSManagedObject.
Let me explain with an example. MLP stands for MyLittleProject
I have the following objects:
MLPPerson+CoreDataProperties.h
@property (nullable, nonatomic, retain) MLPCard *card;
MLPCard+CoreDataProperties.h
@property (nullable, nonatomic, retain) NSString *cardID;
when I am in the code and try:
NSLog(@“%@“, myPerson.card.cardID);
it works great, however when I try to print in the debug console:
po myPerson.card.cardID
I get an error:
error: property ‘card' not found on object of type ‘MLPPerson *'
I am quite confused as this used to work great in older projects I worked on.
I found the answer: the reason why this worked before is because the properties were in a class and now they are in a category.
i.e. the content of MLPPerson+CoreDataProperties.h in other projects was part of MLPPerson.h.
Now, to make the debug console print these, you need use
po [myPerson card] cardID]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With