how to add linebreak in iPhone notification alert

2020-04-30 02:41发布

问题:

what is the code for the line break in the iPhone notification alert message or plain text on

SMS ?

Thanks

回答1:

Indeed with \n

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"message\nwith linebreak" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[alertView release];

This shows an alert with a nice line break.



回答2:

Have you tried '\n'?