CoreData Error - How to Get Data

I explored many questions and documents about returning CoreData errors instead of actual values:

Relationship 'whiskers' fault on managed object (0xb7abab0)

This happens when I try to get a counter for the number of mustaches, for example:

self.numWhiskersLabel.text = [NSString stringWithFormat:@"%d", cat.whiskers.count];

Even if I try to register the installed mustache, I still get the error:

NSLog(@"whiskers: %@", cat.whiskers);

I understand that "Core data will not return a complete object until it is necessary to access the actual value of that object. Each of your returned objects will be an" error "to this point." This is great, but you need to access the actual value . I need a value right now! So how do I get out of this oxymoron? How to access the recruitment account is not considered necessary?

+3
2

. - NSManagedObject. , , - .

, NSManagedObject.

, , po cat? Cat ?

0

, , - NSManagedObjects

, db. .whiskers.count, , , , - .

, ,

NSLog(@"whiskers: %@", [cat.whiskers.anyObject anyProperty]);

NSManagedObject.

+1

All Articles