What will be if I calls simultaneously [[RKClient sharedClient] get@"foo.xml" delegate:self] in two UIViewControllers? Do I have any problems?
viewController_A
{
[[RKClient sharedClient] get:@"foo.xml" delegate:self];
}
viewController_B
{
[[RKClient sharedClient] get:@"foo.xml" delegate:self];
}
I'm guessing that the two different calls would be on two different threads. With this being said no problems should occur, the system should be able to sort out the process, however I am not sure would return 'first'.
So in conclusion as long as the object at
[RKClient sharedClient]
is thread safe (which most objects seem to be unless stated otherwise) no problems should be foundIf you have a look at the RKClient implementation for
get:delegate:
it simply does thisand the implementation for
load:method:params:delegate:
isIt's not using any RKClient state / shared data so you won't see a problem. The method get:delegate: is asynchronous itself so this stuff will happen in the background anyway.