One Quickie


Determining the paragraph style at a particular point (NSTextView->General)
- (NSParagraphStyle *) paragraphStyleInTextView: (NSTextView *) textView
                                        atIndex: (int) index
{
    NSTextStorage *storage = [textView textStorage];

    NSDictionary *attributes;
    NSRange effectiveRange;
    attributes = [storage attributesAtIndex: index
                          effectiveRange: &effectiveRange];

    NSParagraphStyle *style;
    style = [attributes valueForKey: NSParagraphStyleAttributeName];

    return (style);

} // paragraphStyleInTextView



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com