I want my UILabel display text from SQLite database.
But it doesn’t recognize new-line character “\n” – it just prints it on the screen like “Hello \n World”.
This is how I get text value from the DB:
...
NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
myLabel.text = aDescription
...
Any suggestions?
UPD:
This question is not how to display multiple lines in UILabel. It is how to store and later encode newline character in SQLite.
It seems that you save
\nand not the newline character.If you use a SQLite editor you might want to copy past the text from a textedit with the newline character.
If you can’t solve it on the in input side, which you should really do, then you need to replace the literal
\nwith the newline character: