trackLbl2.text = @""Nonstop Bollywood Music"";
I try this but not working. How to text with double quotes.
Try this:
trackLbl2.text = @"\"Nonstop Bollywood Music\"";
You have to put \
before any special character to print it out.
The user before me provided a good answer, but I would like to elaborate on your problem a little bit. It's a good thing to know.
In most (all?) programming languages, certain characters usually serve a special function - single quotes, double quotes, backslashes, and the likes. If you want to include those inside a string, the common practice is to "escape" them, or use escape characters. Escape characters are special character combinations that get replaced with the actual character you want to see inside the string; they usually start with a forward slash (\)*.
Here is a list of common escape characters used in Objective C (source: Wikipedia)
\a - Sound alert
\b - Backspace
\f - Form feed
\n - New line
\r - Carriage return
\t - Horizontal tab
\v - Vertical tab
\ - Backslash
\" - Double quote (used when placing a double quote into a string declaration)
\' - Single quote (used when placing a double quote into a string declaration)
Fun fact: I actually had to escape that forward slash in there by typing "\\".
Try this
trackLbl2.text = @"\"Nonstop Bollywood Music\"";
You have to put \ before any special character to print it out.