现在这是如何实现的?
我知道你曾经用保留来做到这一点:
RKObjectManager *flickrManager =
[RKObjectManager objectManagerWithBaseURL:flickrBaseUrl]; // <-- shared singleton
RKObjectManager *foursquareManager =
[[RKObjectManager objectManagerWithBaseURL:foursquareBaseUrl] retain]; // <-- you must retain every other instance
但是既然你不再使用retain了,你会怎么做呢?
目前,我有 2 个要发送的对象管理器,但我只收到 1 个响应。我猜其中一个请求正在取消另一个请求。
更新
RKURL *baseURL = [RKURL URLWithBaseURLString:@"http://iphone.meer.li"];
RKObjectManager *designObjectManager = [RKObjectManager objectManagerWithBaseURL:baseURL];
//...Mapping design here...
RKURL *URL = [RKURL URLWithBaseURL:[designObjectManager baseURL] resourcePath:[NSString stringWithFormat: @"/%@.json", subUrl]];
[designObjectManager loadObjectsAtResourcePath:[NSString stringWithFormat:@"%@", [URL resourcePath]] delegate:self];
RKObjectManager *designerObjectManager = [RKObjectManager sharedManager];
RKObjectMapping *designerMapping = [RKObjectMapping mappingForClass:[DesignerData class] ];
//...Mapping designer here...
RKURL *URL = [RKURL URLWithBaseURL:[designerObjectManager baseURL] resourcePath:[NSString stringWithFormat: @"/%@.json", subUrl]];
[designerObjectManager loadObjectsAtResourcePath:[NSString stringWithFormat:@"%@", [URL resourcePath]] delegate:self];
所以这是我真正的代码。我不明白为什么它会失败,因为对象管理器应该保留在 ARC 中。
有什么建议么?