hai,
I had referred the documentation. I managed to understand a little concepts by referring some examples from websites. Now the task is partially done .
But the problem now is , this bullets and numberings works only if there is no contents(text) in the textview.
i want to use bullets and numberings to text that is already been typed , likewise in textedit
the code is :
if([[popupbutton titleOfSelectedItem] isEqualToString
"-" ])
{
NSTextStorage *storage=[textview textStorage];
[storage beginEditing];
NSMutableAttributedString *text = [[NSMutableAttributedString
alloc]initWithAttributedString:storage];
NSMutableParagraphStyle *mps = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
NSTextList *listItem = [[NSTextList alloc] initWithMarkerFormat
"{hyphen}" options:NSTextListPrependEnclosingMarker];
[mps setTextLists:[NSArray arrayWithObject:listItem]];
NSMutableString *tabs = [@"\t" mutableCopy];
[tabs appendString
"\t"];
[text appendAttributedString: [[NSAttributedString alloc]
initWithString:[NSString stringWithFormat
"\t%@\t", [listItem markerForItemNumber:1] ]
attributes:[NSDictionary dictionaryWithObject:mps
forKey:NSParagraphStyleAttributeName]]];
[storage setAttributedString:text];
[storage endEditing];
}
please provide me some tips to overcome this problem
thankyou.