我对restkit 0.20有点困惑,我知道他们添加了AFNetworking,所以他们重写了很多方法。
现在我正在寻找与 objektLoaders 几乎相同的方法,例如我想使用:
1.
- (void)objectLoaderRKObjectLoader *)objectLoader didLoadObjectsNSArray *)objects {}
2.
- (void)objectLoaderRKObjectLoader *)objectLoader didFailWithErrorNSError *)error{}
3.
- (void)objectLoaderDidFinishLoadingRKObjectLoader *)objectLoader{}
有人会这么好心并给我一个正确方法的提示吗?非常感谢!
查看他们的wiki page关于迁移到 0.20.0
该页面中与该问题相关的示例似乎是:
这个
[ [RKObjectManager sharedManager] loadObjectsAtResourcePath"/examples" usingBlock:^(RKObjectLoader *loader) {
loader.onDidLoadObjects = ^(NSArray *objects) {
NSLog(@"It Worked: %@", objects);
};
loader.onDidFailWithError = ^(NSError *error) {
NSLog(@"It Failed: %@", error);
};
}];
变成
[RKObjectManager.sharedManager getObjectsAtPath:path parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)
{
NSLog(@"It Worked: %@", [mappingResult array]);
// Or if you're only expecting a single object:
NSLog(@"It Worked: %@", [mappingResult firstObject]);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"It Failed: %@", error);
}];
关于ios - restkit 0.20 - (void) objectLoader didLoadObjects & 其他旧方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13971221/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |