Hello,
I have a problem with Core Data which has left me at the end of my tether. So I was wondering if any of you wonderful people could help.
Basically, I have two entities in a Core Data project. These are:
Author {authorName, dateOfBirth}
Book {bookName, pages}
There is a one-to-many relationship from author to books called 'authors', and an inverse relationship called 'books'. I have exported the subclasses of these entities, and created my fetch controller. Do I now have to define the relationship programatically?
A list of authors is currently displayed in my table view. At the moment, I can only display a list of ALL the books in my Core Data project when I tap on an author. How would I go about accessing a list of books from a particular author? I am presuming I would use an NSPredicate, the logic I have for that so far is:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY authors.bookName LIKE[cd] %@", authorName];
... but I am pretty sure that is incorrect.
I have been crawling the web for hours for an answer and remain confused. So any help would be greatly appreciated.
Many thanks :)