• 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: fileURL - retrieving from NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fileURL - retrieving from NSDocument


  • Subject: Re: fileURL - retrieving from NSDocument
  • From: Christian Brunschen <email@hidden>
  • Date: Wed, 23 Nov 2005 10:47:41 +0000


On 23 Nov 2005, at 09:04, David Wilson wrote:

Hello everyone...

I'm stuck... confused... not sure where to go... that lead me here! :-)


I have a Document based App, built by Xcode, so the default NSDocument is call MyDocument (I've left that unchanged). I want to know what the FileName of the currently active window is, so after reading the NSDocument document, it looked like "fileURL" was the right thing to call, it would return the documents filename for me. Perfect!


However, [self fileURL]is returning a compiler warning >'MyDocument' may not respond to '+fileUR'L<


+ (NSURL *)diskFileName { NSURL * documentURL; documentURL = [self fileURL]; return documentURL; }


I'm confused, probably off track...


The '+' in '+fileURL' indicates that the compiler is looking for a *class* method 'fileURL' - which is because you have written '+ (NSURL *)diskFileName', which declares 'diskFileName' as a class method, and which attempts to send the 'fileURL' message to 'self' - which, in a class method, is the class object for the class in question. You probably meant to write '- (NSURL *)diskFileName', which would make it an instance method.

- David

Best wishes,

// Christian Brunschen

_______________________________________________
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: 
 >fileURL - retrieving from NSDocument (From: David Wilson <email@hidden>)

  • Prev by Date: Spotlight introspection
  • Next by Date: Re: Measuring a string
  • Previous by thread: fileURL - retrieving from NSDocument
  • Next by thread: Spotlight introspection
  • Index(es):
    • Date
    • Thread