user391986
user391986

Reputation: 30906

how to handle multiple ASIFormDataRequest - iphone development

I am using ASIFormDataRequest to send http requests but they all go to the same function requestFinished. Inside this function how can I know from which request it came from? Is there any way for me to add some kind of tag name to request that comes in?

I would prefer to use one function and have a switch statements instead of having two functions per http requests and manually setting the functions [request setDidFailSelector:@selector(requestFailed:)]; [request setDidFinishSelector:@selector(requestFinished:)];

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setDelegate:self]; [request startSynchronous];

Upvotes: 0

Views: 357

Answers (1)

Alex Reynolds
Alex Reynolds

Reputation: 96967

You could subclass ASIFormDataRequest or wrap an instance of it in a utility class. You then add your own tag-like property to instances of your subclass or wrapper object.

Upvotes: 1

Related Questions