I am new to Core Data programming and am trying to work out the concepts involved. I have an object called a Lease that has a many-to-many relationship with Apartment objects. Given a Lease object, how do I get a count of the related Apartment objects or an NSArray of the related objects?
Thank you!
~~Garth
There are a couple different ways:
Using the generated Core Data accessor:
Using KeyPaths:
Using KVC (if your class is fully KVC-compliant):
Using a fetch request:
Feel free to mix-and-match those lines.