I use the reskit to comsume webservice
I have the following code:
The first line: get the Token from a web service
tokenID = [self getTokenID];
The second line get a JSON from the same web service
[self sendRequest:tokenID];
But when execute the program.. the tokenID is not ready for the second line…
then I get the 401 error (unauthorized)
Is it possible Synchronize both methods?
For example:
When the “getTokenID” method is finished then execute the second method “sendRequest:tokenID”
Regards
I think you are using a asynchronous call inside your getTokenID
When I look on the documentation of Restkit you should have something like this in your code:
There, in the completion Block, you can get your token from the result and execute your
Sorry that I am so vague, but I need to see your code in getTokenID to give you a better answer.