使用Objective-C在iOS警报消息中添加换行符

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用Objective-C在iOS警报消息中添加换行符相关的知识,希望对你有一定的参考价值。

一个菜鸟问题。

我有一个提醒:

"alertMessage" = "This is my message:    1  2  3.  And another one: 5 6 7";

我正在展示:

NSString *asd = NSLocalizedString (@"alertMessage", @"");
NSString *alertTitle = NSLocalizedString (@"alertTitle", @"");

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:alertTitle message:asd delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];

我如何实现换行,以便“另一个:”从第二行开始。

谢谢!

答案

在邮件中添加换行符( n)。

另一答案

在字符串文字中添加 n。

More details here

以上是关于使用Objective-C在iOS警报消息中添加换行符的主要内容,如果未能解决你的问题,请参考以下文章