Re: fileURL - retrieving from NSDocument
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