• 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: Getting filename in NSDocument readFromData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting filename in NSDocument readFromData


  • Subject: Re: Getting filename in NSDocument readFromData
  • From: Pascal Harris <email@hidden>
  • Date: Thu, 29 Apr 2010 20:13:11 +0100

Sometimes, I find, I get so fixated on one particular solution that I can't see the wood for the trees. Thanks for your response though - it did, at least get me thinking.

So, if anyone else has the same (slightly numpty) query, the answer is to forget NSData - remember that we're talking about an NSDocument window. So [self fileURL] will provide the answer. Sorry for wasting your time!

-Pascal

On 28 Apr 2010, at 19:40, Kyle Sluder wrote:

On Wed, Apr 28, 2010 at 11:37 AM, Pascal Harris
<email@hidden> wrote:
How do I get the filename of the source document when using NSDocument readFromData?

Just override -readFromURL:ofType:error: instead. The documentation is quite clear about this method's implementation simply being a wrapper around -readFromFileWrapper:ofType:error, which in turn is documented to just be a wrapper for -readFromData:ofType:error:.

--Kyle Sluder

_______________________________________________

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


References: 
 >Getting filename in NSDocument readFromData (From: Pascal Harris <email@hidden>)
 >Re: Getting filename in NSDocument readFromData (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Strange NSScroller sizing behaviour
  • Next by Date: Re: Scripting Bridge for GUI scripting?
  • Previous by thread: Re: Getting filename in NSDocument readFromData
  • Next by thread: advancementForGlyph problem
  • Index(es):
    • Date
    • Thread