Hi all,
I am using this code for accessing data from server,
NSString *post = [[NSString alloc] initWithFormat:@"Email=%@",GEmail];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSURL *url = [NSURL URLWithString:@"http://smads.in/day.php"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setHTTPMethod:@"POST"];
[theRequest setValue:postLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPBody:postData];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if( theConnection )
{
webData = [[NSMutableData data] retain];
}
else
{
}
it fetch data slightly late so problem is that-- i have a code which check fetched data from server--
If(flag==1)
NSlog(@"YES");
else
NSlog(@"NO");
when i click first time then it print NO when i again click then it display yes.
how i check condition in one click?
suggest me if any idea.....
Thanks,
Arun