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分钟后死掉。请给我一个解决方案。
您能否检查设备和计算机的互联网连接。