2011-04-08 73 views
0

我正在使用SQLite從數據庫讀取一些內容。iPhone - 如何在SQLite結果中添加一個新行到UIAlertView

然後它將顯示在UIAlertView

內容包含一些新的行符號「\ n」。

但是,它不會在警報中創建新行。相反,顯示「\ n」。

以下是我的代碼部分:

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]; 

有什麼我可以做,使之可識別?

在此先感謝!

回答

0

字符串換行字符將工作沒有任何SPL實現

例如

UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Print " message:@"line1\nline2\nline3\nline4" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; 
[alert show]; 
[alert release]; 

只是打印,並檢查你的描述是否屬於以下格式

+0

感謝。該字符串是從SQL的結果中加載的,並保存在NSString描述中。當我將描述放在適當位置時,我認爲它不會轉換爲UIAlertView可以識別的正確字符集。 – 2011-04-08 05:17:02

相關問題