Forrest
Forrest

Reputation: 127943

Why single backslash turns to double backslash

The string "\domain\path1\path2" was turned to "\\domain\\path1\\path2" after using AFNetwork to get the JSON response.

I got two comments "they are same",but the point is that when we use NSURL to create a remote url for EGOImageView to load, that will be different. The double \\ will get failed.

Why this happened ?

Upvotes: 0

Views: 258

Answers (1)

neilco
neilco

Reputation: 8012

The backslash character is an escape character which is usually followed by a control character. The escape sequence for a literal backlash is \\. It's worth noting that the backslash is not a path separator in iOS. That would be a forward slash.

Upvotes: 0

Related Questions