AFIncrementalStore Problems fetching multiple remote relationships

ⅰ亾dé卋堺 提交于 2019-12-25 04:31:30

问题


I have a problem with AFIS fetching remote relationships, i'm connecting to Apigee API, properly setting relationships at

- (NSDictionary *)representationsForRelationshipsFromRepresentation:(NSDictionary *)representation
                                                           ofEntity:(NSEntityDescription *)entity
                                                       fromResponse:(NSHTTPURLResponse *)response;

then, spent a lot of time debugging, found that relation name and URL build is correct, exactly as i want but the AFHTTPClient never makes the network call, found out the reason in method:

- (id)newValueForRelationship:(NSRelationshipDescription *)relationship
              forObjectWithID:(NSManagedObjectID *)objectID
                  withContext:(NSManagedObjectContext *)context
                        error:(NSError *__autoreleasing *)error;

line

if ([request URL] && (![[context existingObjectWithID:objectID error:nil] hasChanges]))

because hasChanges always returns YES.

Any advice ?

来源:https://stackoverflow.com/questions/19294613/afincrementalstore-problems-fetching-multiple-remote-relationships

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!