iPhone - How to add a new line within a SQLite result to UIAlertView
I'm reading some content from database using SQLite.
It then will be shown in a UIAlertView
.
The content contains some new line symbol "\n".
However, it doesn't create a new line in the alert. Instead, the "\n" is shown.
Following is portion of my code:
description = [[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(selectStatementE, 0)];
UIAlertView *alert 开发者_开发知识库= [[UIAlertView alloc]initWithTitle:@"something" message:description delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
[alert show];
Is there anything I can do to make it recognisable?
Thanks in advance!
string with new line character will work without any spl implementation
example
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Print " message:@"line1\nline2\nline3\nline4" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
just Print and check whether your description belongs to following format
精彩评论