I have a strange behave: After making a few changes in my code, I got an unasked URL in the NSURL. Actually, this URL was valid in a test I made yesterday, but the system remembers this URL and I cannot changed it even in another app.
When I strted a ne开发者_StackOverflow社区w app with the followung code:
int main(int argc, char *argv[]) {
NSURL *URLurl = [NSURL URLWithString:@"http://www.google.com"];
NSLog([URLurl absoluteString]);
}
the baseUrl is something like: http:inl.co.il, even I asked for google.com, the NSLog is correct and prints: http://www.google.com
But it does not help me since the base is what the entire code works with.
And strangly, where from is that NSURL taking this old unused string?
Any help?
Thank you
Never log variables directly inside of NSLog
like this, as any percent symbols will easily cause mayhem. Instead do:
NSLog(@"%@", [URLurl absoluteString]);
Lacking further information, this is probably the root of the problem. Also, the compiler should be warning you your original statement is dodgy, anyway.
精彩评论