Pregunta

I want to create a NSString that contains some HTML-Code. But as the HTML code contains a " the string ends too early.

This is the HTML code I want to add.

<FONT FACE="arial">arial font</FONT>

This is how I do it:

NSString *myHTMLcode = @"<FONT FACE="arial">arial font</FONT>"

As you can see, it stops too early (before the arial) What do I have to do in order to get a NSString that contains a "?

Thank you very much!

¿Fue útil?

Solución

Use the standard (Objective-)C(++) escape character:

@"A string with a quote \", a tab \t, a new line \n, and a backslash \\";
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top