• 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
AttributedString from NSData on iPhone.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AttributedString from NSData on iPhone.


  • Subject: AttributedString from NSData on iPhone.
  • From: Sandro Noël <email@hidden>
  • Date: Thu, 5 Aug 2010 11:16:29 -0400

Hello.

I'm trying to take an attributed string from a PDF document and reproduce it on the phone.
passing thru a SQLite Database.

basically, i write to the database using

NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObject:NSRTFDTextDocumentType forKey:NSDocumentTypeDocumentAttribute];
[dict setValue:[NSNumber numberWithInt: NSUTF8StringEncoding] forKey:NSCharacterEncodingDocumentAttribute];

NSData *stringData = [[tempString dataFromRange:range documentAttributes:dict error:&error] copy];
node.attributedStringData = stringData;

*Node is my Managed Object Model entity, tempString is the attributed string from the PDF.

So all the attributed strings get inserted into the database, and that database is sent to the iPhone
Back on the iphone, I'd like to restore that attributed string from core data to an NSAttributedString object.

and write that attributed string into a custom UITableViewCell, presumably using CoreText.

any pointers on how that could be done?
or am I over doing it and missed out on a cool class that does it all for me... as usual...

best regards
Sandro Noel._______________________________________________

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: AttributedString from NSData on iPhone.
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Resolution of an NSImage(Rep)?
  • Next by Date: Re: Resolution of an NSImage(Rep)?
  • Previous by thread: Re: calling a function in one class from another
  • Next by thread: Re: AttributedString from NSData on iPhone.
  • Index(es):
    • Date
    • Thread