Re: Method without receiver
Re: Method without receiver
- Subject: Re: Method without receiver
- From: Brent Gulanowski <email@hidden>
- Date: Tue, 8 Jul 2003 10:37:53 -0400
On Tuesday, July 8, 2003, at 05:35 AM, Cyprien wrote:
I'm trying to make a little method which will check that every
NSTextField of my interface isn't empty. I want it to be a method
because I will use it often in other methods.
You would have to design a class which contained the method. A method
cannot exist on its own. You would probably put it into a window
controller or document class. Put it into the class that cares the most
and/or "knows" about your text fields.
It return a variable of type int. But I don't know how to implement it.
An instance method requires a receiver. A class method doesn't work
(selector not recognized). And a C fonction doesn't allow to do
[aTextField stringValue] ...
Well, actually, it can, if the function is defined in a *.m file, but
the function would be part of a class anyway in most cases, or called
from a class instance, so it may as well be a method of that class.
Brent
No one really knows enough to be a pessimist. -- William Blake
_______________________________________________
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.