• 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
Re: How to use NSDocument to load and display an XML file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use NSDocument to load and display an XML file?


  • Subject: Re: How to use NSDocument to load and display an XML file?
  • From: Cameron Hayne <email@hidden>
  • Date: Thu, 18 Aug 2005 18:51:58 -0400

On 18-Aug-05, at 6:11 PM, Chancellor, Robert wrote:

I am aware that I should be also providing an implementation of
daraRepresentationOfType and loadDataRepresentation, but am unclear as
to what code is expected in these implementations? Should I call the new
NSXml class directly from these methods to load the XML data? I was
under the assumption that NSDocument handled the loading of the data
itself given the proper support?

I think you need to buy a book on Cocoa - that will make things a lot easier.
But here's a few pointers:
The 'loadDataRepresentation' method will get called when the user opens the document.
One of the args to this method is an NSData object holding the raw file contents. It is up to you to implement this method (or one of the other two methods used for loading a file - read the NSDocument docs) and decipher the data (your XML) and then figure out how you want to display it in your view - e.g. as an NSString that you would then pass to your NSTextView.


--
Cameron Hayne
email@hidden


_______________________________________________ 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
References: 
 >How to use NSDocument to load and display an XML file? (From: "Chancellor, Robert" <email@hidden>)

  • Prev by Date: Re: Unicode in AppleScript
  • Next by Date: Re: Unicode in AppleScript
  • Previous by thread: How to use NSDocument to load and display an XML file?
  • Next by thread: CoreData Parent Entity Confusion
  • Index(es):
    • Date
    • Thread