i am new to IOS development and Restkit. I am creating an application in which data is loaded from external webservice in json format and there are Thousands of objects of users, which are mapping in coredata.
I am loading these user as following:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
DBUser* user = [DBUser currentUser];
if ([user isLoggedIn]) {
[self loadRequiredData];
}
}
Then in loadRequiredData
- (void)loadRequiredData {
RKObjectManager *manager = [RKObjectManager sharedManager];
manager.requestQueue.concurrentRequestsLimit = 10;
[manager loadObjectsAtResourcePath:@"/users" delegate:self];
}
It takes almost 4-5 minutes to map all user objects in CoreData. Now the problem is that when Restkit is busy in mapping these thousands of users in CoreData, any other request sent to webservice goes to waiting. When all the users are mapped in CoreData then the waiting requests are performed.
I have even tried to increase number of ConcurrentRequestLimit to 10
manager.requestQueue.concurrentRequestsLimit = 10;
but this too don't work
So is there any way to map objects in background or in some other thread? So that any other request sent during this period should be performed quickly.