NSData *myRequest = [NSString stringWithFormat:(@"&site=%@&key=%@",tmpSite,tmpKey)];
Why is this not working ?
Thanks
NSData *myRequest = [NSString stringWithFormat:(@"&site=%@&key=%@",tmpSite,tmpKey)];
Why is this not working ?
Thanks
Problem is that you are assigning NSString
instance to variable of NSData
type. Try this:
NSString* s = [NSString stringWithFormat:@"&site=%@&key=%@",tmpSite,tmpKey];
NSData* d = [s dataUsingEncoding:NSASCIIStringEncoding]; //or any other encoding!
NSData *myRequest = [[NSString stringWithFormat:(@"&site=%@&key=%@",tmpSite,tmpKey)] dataUsingEncoding: NSASCIIStringEncoding];
You can't just mix the two classes like that.