i've set the bold menu item by setting the action addFontTrait in 
fontmanager.Now it is working i can give the data's as bold italic etc in
textView.

I tried to convert it to HTML form by using the code.
  NSString * aTitle = @"Sample";
  NSArray*        excluded = [NSArray arrayWithObjects:  
@"doctype",@"p",@"meta",@"xml",@"span",  nil];
  NSDictionary*    attr = [NSDictionary dictionaryWithObjectsAndKeys:
                          NSHTMLTextDocumentType,
NSDocumentTypeDocumentAttribute,
                          aTitle, NSTitleDocumentAttribute,excluded,
NSExcludedElementsDocumentAttribute,
                          [NSNumber numberWithInt: NSASCIIStringEncoding],
                          NSCharacterEncodingDocumentAttribute,nil];
  NSData*        tData = [str dataFromRange: NSMakeRange(0, [str length])
documentAttributes: attr error: nil];


It giving html code, but it doesn;t giving <B>,<I>,<U> and colour tags
corresponding to the texts in textview.

Another qustion is how can i display this html code in my textview,I've tried

 NSDictionary ** dict = &attr;
  NSData*        tData = [str dataFromRange: NSMakeRange(0, [str length])
documentAttributes: attr error: nil];
        NSAttributedString *attrString = [[NSAttributedString 
alloc]initWithHTML:
tData
                                 documentAttributes: dict];
   [[htmlView textStorage] setAttributedString: attrString];

But it also displays the same string not html code.


More speccific
 My first question is how can i get underlinetext or italictext to
<u>unerlinetext</u>  or <i> italictext </i> etc...

SEcond question is How can write html code to textView?if NSData gives
html code.
I've found another prooblem in my application,I clicked on the zoom button
of the window in interface builder3.0,Now i couldn;t open that window and
couldn't load at run time.Expecting reply.

thanks

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to