For some odd reason, you should use. \:So, it will be
[data writeToFile:@"/Documents/te\:st.pdf" atomically:YES encoding:NSUTF8StringEncoding error:nil]
It works, but the compiler complains about an unknown escape sequence. If you run ls -lain the folder where you create the slash file, you will see that it is calledthe:st.pdf
source
share