• 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
How do I manually convert NSTextStorage --> NSData object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I manually convert NSTextStorage --> NSData object?


  • Subject: How do I manually convert NSTextStorage --> NSData object?
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Wed, 28 Dec 2005 15:53:49 -0800

I want to store a NSTextStorage (data from a NSTextView) object into a persistent store (as a binary) and hence, need it in NSData format.

Scenario:

'My Memo' (NSTextStorage) --- > 'textData' (NSData) --> 'MyStoredMemo' (binary) within entity.

I understand I need to encode 'NSTextStorage' into a NSData object but I can't figure out how (beyond writing out to a file).

The NSTextStorage object is an instantiated variable within my NSPersistentDocument.

Is there some simple in-line encoding method to convert NSTextStorage into NSData?

Something like ...

NSData *textData = [NSData initWithTextStorage:myTextStorage];

...within a routine?

Ric.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: How do I manually convert NSTextStorage --> NSData object?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: bindings, popup menu, and additional options
  • Next by Date: Re: How do I manually convert NSTextStorage --> NSData object?
  • Previous by thread: Re: [OT] A bit confused on pointers...
  • Next by thread: Re: How do I manually convert NSTextStorage --> NSData object?
  • Index(es):
    • Date
    • Thread