0

I have a UIAlert view popping up when a button is pressed. I want to have separate lines of text, certain text in each line. When I currently run the app, it shows it in the paragraph. This is the code:

- (IBAction)popupalert:(id)sender {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Lesson Timing" message:
                      @"Lesson 1: 7:40-8:20, Lesson 2: 8:22-9:02, Breakfast Break: 9:02-9:15, Lesson 3: 9:15-9:55, Lesson 4: 9:57-10:37, Lesson 5: 10:39 - 11:19, Second Break: 11:19-11:29, Lesson 6: 11:29-12:09, Lesson 7: 12:11-12:51, Lesson 8: 12:53-1:33, Lunch Break: 1:33-1:58, Private Study: 1:58-2:38, Lesson 9: 2:40-3:15" delegate:nil cancelButtonTitle:@"Done" otherButtonTitles:nil, nil];
[alert show];

}

I want each lesson to be on a different line.

1
  • Just use standard line break \n where you want a line to move onto the next line
    – Popeye
    Jun 25, 2013 at 11:03

1 Answer 1

0

If you simply want to put the text on separate lines, you can do so by formatting the string with line break (\n) characters, e.g.

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Lesson Timing" 
                                               message:@"Lesson 1: 7:40-8:20, \nLesson 2: 8:22-9:02, \nBreakfast Break: 9:02-9:15, \nLesson 3: 9:15-9:55, \nLesson 4: 9:57-10:37, \nLesson 5: 10:39 - 11:19, \nSecond Break: 11:19-11:29, Lesson 6: 11:29-12:09, Lesson 7: 12:11-12:51, Lesson 8: 12:53-1:33, Lunch Break: 1:33-1:58, \nPrivate Study: 1:58-2:38, \nLesson 9: 2:40-3:15" 
                                              delegate:nil 
                                     cancelButtonTitle:@"Done" 
                                     otherButtonTitles:nil, nil];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.