I guess I really need to brush up on my basics. I seem to be having trouble with concatenating strings. My issue:
This doesn't work:
Yet strangely this does:
What i mean by works and doesn't is in the first one, aString initWithContentsOfURL returns nothing, yet it returns what it is supposed to in the second. Am I doing something wrong with the strings, or could it be my URL connection I need to diagnose? Thanks for any advice!
This doesn't work:
Code:
NSString *txt=@"MyPost";
NSString *url=[NSString stringWithFormat:@"mydomain.com/newfeedbackiphone.php?text=%@",txt];
NSString *aString = [[NSString alloc] initWithContentsOfURL:[[NSURL alloc] initWithString:url]];
Yet strangely this does:
Code:
NSString *aString = [[NSString alloc] initWithContentsOfURL:[[NSURL alloc] initWithString:[NSString stringWithFormat:@"mydomain.com/newfeedbackiphone.php?text=MyPost",txt];]];
What i mean by works and doesn't is in the first one, aString initWithContentsOfURL returns nothing, yet it returns what it is supposed to in the second. Am I doing something wrong with the strings, or could it be my URL connection I need to diagnose? Thanks for any advice!