Escaping " in NSString stringWithFormat is being goofy

102 Views Asked by At

I use

NSString *copyCommand=[NSString stringWithFormat:@"put \"%@\" \"%@\"",sourceEscaped,destinationDirectory];

but the actual NSString includes the \

For example, if sourceEscaped=test and destinationDirectory=test I expect the NSString to contain:

put "test" "test"

and not

put \"test\" \"test\"

Note the directoryCommand in the example below:

enter image description here

0

There are 0 best solutions below