The reason is that %
has meaning both to percent-encoding of URLs and also to format strings. In this case +stringWithFormat
sees the %20+
in your string, and thinks you're giving it a format command. For literal %
in your URL format string, make them %%
, that is, pass %%
to string formatting methods / functions to get a literal %
.
However, in your particular case, I'm not sure which ones you're trying to substitute for the locations and which ones you're meaning to stand as percent-escapes.