iosobjective-cafnetworkingrestkitrestkit-0.24.x

Error Domain=org.restkit.RestKit.ErrorDomain Code=-1011 "Expected status code in (200), got 504" - Only in real Device


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];

My code is perfectly working in iOS Simulator and when i run on real device it is not working.It waits 5 minutes to get the response in simulator but in device it dies after 1 minute.Please give me a solution.


Solution

  • Can you check internet connection of both device and computer.