AFIncrementalStore获取多个远程关系时出现问题

时间:2013-10-10 11:31:14

标签: ios objective-c core-data afnetworking afincrementalstore

我遇到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

有什么建议吗?

0 个答案:

没有答案