我遇到AFIS
获取远程关系的问题,我正在连接Apigee API,正确设置
- (NSDictionary *)representationsForRelationshipsFromRepresentation:(NSDictionary *)representation
ofEntity:(NSEntityDescription *)entity
fromResponse:(NSHTTPURLResponse *)response;
然后,花了很多时间调试,发现关系名称和URL构建是正确的,完全按照我的意愿但AFHTTPClient从不进行网络调用,找出方法中的原因:
- (id)newValueForRelationship:(NSRelationshipDescription *)relationship
forObjectWithID:(NSManagedObjectID *)objectID
withContext:(NSManagedObjectContext *)context
error:(NSError *__autoreleasing *)error;
行
if ([request URL] && (![[context existingObjectWithID:objectID error:nil] hasChanges]))
因为hasChanges
始终返回YES
。
有什么建议吗?