Re: Seemingly ridiculous problem...
Re: Seemingly ridiculous problem...
- Subject: Re: Seemingly ridiculous problem...
- From: Sam Goldman <email@hidden>
- Date: Thu, 14 Feb 2002 01:06:47 -0800
initByReferencingFile: is not a class method. Methods with a + before them
are class actions and are used like so [NSString stringWithString:@"Hello"].
You are trying to use an instance method (one that an instance of a class
uses) as a class method.
More simply, it is looking for +initByReferencingFile: and that doesn't
exist.
Change it to this
- (id)function
{
NSImage* pointer;
Pointer = [[NSImage alloc] initByReferencingFile:@"filename.jpg"];
... // Return something, of course
}
- Sam
On 2/14/02 12:55 AM, "Kigney" <email@hidden> wrote:
>
In a function, I am doing this:
>
>
-(id)function
>
{
>
NSImage* pointer;
>
pointer = [NSImage
>
initByReferencingFile:@"filename.jpg"];
>
...
>
}
>
>
WHY am I getting these compile errors:
>
warning: cannot find class (factory) method.
>
warning: return type for `initByReferencingFile:'
>
defaults to id
>
>
I have the cocoa framework included, as well as AppKit
>
and Foundation.
>
I included cocoa.h with the file...
>
>
Are these functions undeclared in the Cocoa framework
>
(and not thus documented by apple?), or am I missing
>
something ridiculously obvious? sorry if this is a
>
dumb question...
>
>
Thanks
>
-Josh
>
Send FREE Valentine eCards with Yahoo! Greetings!
>
http://greetings.yahoo.com
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
--
Windows is a 32-bit patch to a 16-bit shell for an 8-bit operating system
written for a 4-bit processor by a 2-bit company without 1 bit of sense.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.