Closed Arcovv closed 7 years ago
The attributes you defined in the LibraryItemResource
are called books
and readings
, but they are called book
and reading
in your JSON. They should match. Because this is a to-one relationship, the singular form is probably correct.
Environment
Xcode Version 8.2.1 (8C1002) Swift 3.0
Code
There's my json data format:
There's my Resource classes:
For test, I implemented my code like this:
The
spine
had call myonSuccess
callback and gave me some resources.But in the for-in loop,
libraryItemResource.books
andlibraryItemResource.readings
are always nil.I have verified that
query.include("books", "readings")
is not what I expected to use.But I still don't know how to get the data from
included
json and assign them to thelibraryItemResource
.Thanks for your help!