• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
string to html.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

string to html.


  • Subject: string to html.
  • From: email@hidden
  • Date: Fri, 16 May 2008 06:42:59 -0400 (EDT)
  • Importance: Normal

hi,

I've to convert text or image to its corresponding html code.
i've done

setContentType: @"text/html";
setContentTransferEncoding:None;
setCharset: @"us-ascii"


 NSDictionary*    attr = [NSDictionary
dictionaryWithObject:NSHTMLTextDocumentType
forKey:NSDocumentTypeDocumentAttribute];


 NSAttributedString*    textValue = [[NSAttributedString alloc]
 initWithString: [self messageField]];//where messageField returns string.
 NSData*        tData = [textValue dataFromRange: NSMakeRange(0, [[self
messageField] length])
                         documentAttributes: attr error: nil];


tData still giving the text value not it scoresponding html code.So is it
right way?or Am i mis anything here?Anybody can help me?

Thanks



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: string to html.
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Workaround for _NSCFURLProtocolBridge bug in AppKit?
  • Next by Date: Re: NSDictionaryController with NSTableView and sorting of numeric data
  • Previous by thread: Workaround for _NSCFURLProtocolBridge bug in AppKit?
  • Next by thread: Re: string to html.
  • Index(es):
    • Date
    • Thread