• 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: Method without receiver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Method without receiver (From: Cyprien <email@hidden>)

  • Prev by Date: Re: NSString to int (or double) conversion
  • Next by Date: Re: Sudden problems with linking my project
  • Previous by thread: Method without receiver
  • Next by thread: Re: 15 Hz sine wave
  • Index(es):
    • Date
    • Thread