0

How can i add bullet points to my application as shown below.

something like this;

I will have a String in the format of "one , list item, list item" i need it to be broken down to -

  • one
  • List item
  • List item
sharon
  • 580
  • 12
  • 28

2 Answers2

4

You can use Unicode characters:

NSString *stringWithBullets = @"\u00b7 one";

will produce:

• one

hwaxxer
  • 3,363
  • 1
  • 22
  • 39
3

I've used this to make a bullet list from a NSMutableArray of NSString's and display it in a UITextView:

   NSMutableArray * items = [[NSMutableArray alloc]initWithObjects:@"1:00",@"2:00",@"3:00",@"4:00",@"5:00",@"6:00",@"7:00",@"8:00",@"9:00",@"10:00",@"11:00",@"12:00", nil];

    NSMutableString * bulletList = [NSMutableString stringWithCapacity:items.count*10];

    for (NSString *aString in items)
    {
        [bulletList appendFormat:@"\n\u2022 %@", aString]; //\u2022 bullet symbol
    }

    self.myTextView.text = bulletList;

Also check out the Unicode characters:

http://en.wikipedia.org/wiki/List_of_Unicode_characters

Hubert Kunnemeyer
  • 2,261
  • 1
  • 15
  • 14