开发者

ResKit iOS - Application crash when i receive HTTP Error Code in RKObjectManager postObject method

开发者 https://www.devze.com 2023-03-10 21:56 出处:网络
i\'m using RKObjectM开发者_运维技巧anager to make iOS RESTful requests to map responses to local objects. When i receive HTTP error codes like 400, RestKit sends data to RKObjectLoaderDelegate method:

i'm using RKObjectM开发者_运维技巧anager to make iOS RESTful requests to map responses to local objects. When i receive HTTP error codes like 400, RestKit sends data to RKObjectLoaderDelegate method:

- (void)objectLoaderDidLoadUnexpectedResponse:(RKObjectLoader *)objectLoader

but immediately afterwards the application crash without any reason. The debugger doesn't give me any more information, where and why the application crashes.

To make the request

RKObjectManager * objectManager = [RKObjectManager objectManagerWithBaseURL:SERVER_BASE_URL];

RKDynamicRouter* router = [[RKDynamicRouter new] autorelease];
objectManager.router = router;
objectManager.format = RKMappingFormatJSON;

[router routeClass:[RKTUser class] toResourcePath:@"sessions" forMethod:RKRequestMethodPOST];

[[RKObjectManager sharedManager] postObject:user delegate:self];

Anyone with the same problem?


I just updated RestKit framework, and it start to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消