I am sending a request and on receiving the response i need to check the condition and only then navigate to the next screen but then this condition is checked even before i receive the response. How can i check the condition only after receiving the response. Thanks in advance.
Share
Are you using NSURL Connection or any Component??
Try using NSURL Connection delegates. Check out this link:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLConnection .
I think any of the two methods will work.
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data OR
– (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response