Error Domain = org.restkit.RestKit.ErrorDomain代码= -1011“(200)中的预期状态代码,得到504”-仅在真实设备中

问题描述 投票:0回答:1
RKObjectManager *manager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:BASE_URL]];

PPPSynchronization *synchObj = [[PPPSynchronization alloc] init];
[synchObj configureRestKitWithManager:manager withSyncType:CUSTOMER_POST_DATA];

class_customer_list_request *requestObj;
NSMutableURLRequest *request = [manager requestWithObject:requestObj method:RKRequestMethodPOST path:PPP_ESM_POST_COMPONENT parameters:postDict];

[request setTimeoutInterval:300];

RKObjectRequestOperation *op = [manager objectRequestOperationWithRequest:request success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
...

}failure:^(RKObjectRequestOperation *operation, NSError *error) {

}];
[manager enqueueObjectRequestOperation:op];

我的代码在iOS Simulator中运行良好,当我在真实设备上运行时,它无法正常工作。它需要等待5分钟才能在模拟器中获得响应,但在设备中却会在1分钟后死掉。请给我一个解决方案。

ios objective-c afnetworking restkit restkit-0.24.x
1个回答
0
投票

您能否检查设备和计算机的互联网连接。

© www.soinside.com 2019 - 2024. All rights reserved.