Hello everyone I have an objective-c dilema :P I am quite new to objective-c, and I have tried searching for an answer, but to no avail.
So, here is my situation. I will put the code here now, or else it won't make as much sense. I am putting down what I need, this code does not work right now, and I will get to why later
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMMM"];
NSString *monthString = [formatter stringFromDate:date];
NSLog(@"MONTH STRING %@", monthString);
NSString *baseURLStr = @"http://www.mysite.ca/example";
NSURL *url = [NSURL URLWithString:[baseURLStr stringByAppendingFormat:@"announcements%20%@%20%d%20carson.ashx", monthString]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[NSCalendar release];
So, this is where the problem lies... Encoded (HTML): stringByAppendingFormat:@"announcements%@%20%d%20example.ashx", monthString, day]];
Decoded it looks like this
stringByAppendingFormat:@"announcements %@ %d example.ashx"]];
That should be easier to understand.. When I run with the %20's, it says "The requested document was not found" When I run with spaces (" ") it is just white, and nothing loads.
I know the URL is correct, and if I take the variables out, it is the exact same problem, but when I move the %20's back to the baseURLStr, it works and loads just fine, so it is something to do with the HTML Codes and the "stringbyAppendingFormat" string.
Any help is appreciated!
Thanks for your time
-Kyle