ios - RestKit Pagination mapping error -
the pagination documentation suggests:
the paginator must configured pagination-mapping specifying how configuration metadata mapped out of response payload. configured mapping must have objectclass of rkpaginator , should include attribute mappings currentpage, pagecount, perpage, , objectcount. example, given paginated resource loaded ‘/articles?page=1’ following json:
{ "pagination": { "per_page": 10, "total_pages": 25, "total_objects": 250 }, "articles": [ // array of articles ] }
but if api doesn't provide me total_pages, gives me total_objects? can calculate total pages combination of per_page , total_objects. have feeling difference causing mappings not map.
that should fine. paginator uses perpage
, objectcount
calculate pagecount
(the project open source can verify , debug happens during mapping).
if turn on trace logging should information what's happening during pagination mapping stage (like if didn't map, didn't have enough info or did map , calculation was). turn on trace logging with:
rklogconfigurebyname("restkit/objectmapping", rklogleveltrace); rklogconfigurebyname("restkit/network", rklogleveltrace);
Comments
Post a Comment