Hello,
I am new to Core Data and am stumbling on the right way to set up a query.
My managed object model includes the classes Apartment, Lease, and what I would otherwise call a join table called ApartmentLease. This looks like:
/-----------------\ /-----------------\ /-----------------\
| Apartment | | ApartmentLease | | Lease |
|-----------------| |-----------------| |-----------------|
| number | | startOn | | occupantName |
|-----------------| | endOn | | monthlyRate |
| apartmentLeases |-\ |-----------------| | occupantPhone |
\-----------------/ \->>| apartment | |-----------------|
| lease |<<----|apartmentLeases |
\-----------------/ \-----------------/
So what I have tried to model is that a Lease can have many Apartments and each Apartment in the lease has its own start and ending dates.
So my question is: Given a range of dates, how can I query the Apartment object and get back an array of all the Leases that occupied the Apartment during that date range?
Thanks and sorry for my horrible ASCII art!
Bert