Reputation: 10021
I'm trying to do the following in xcode:
NSString *URL = @"http://someUrl/page.php";
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:URL]];
but I'm not sure if the forward slashes are maintained when they are in double quotes. I don't know what the rules are for ios characters in single/double quotes.
does the URL String remain exactly as was declared in the quotes? thanks
Upvotes: 2
Views: 3126
Reputation: 2550
You can do that, I've used that often without any problems. If you wanted the backslash (\), then you would have to escape it.
Upvotes: 5
Reputation: 136
The string in your example will be exactly as you declared it. For reference, \
is the escape character for strings in objective-c. If you want to use a backslash, you would then have to double it (e.g., \\
).
Upvotes: 3