• 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: Pre declaration of methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pre declaration of methods


  • Subject: Re: Pre declaration of methods
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 6 Apr 2003 11:44:49 -0400

On Sunday, April 6, 2003, at 11:09 AM, Jirtme Paschoud wrote:

I just didn't put the methods declarations in the header of the
class. But when I do that if I'm using a "firstMethod" that calls a
"secondMethod" that is a few lines down, I'm getting a:

warning: `myClass' does not respond to `secondMethods'

But the code compile sucessfully and works as expected.

Is that possible to pre declare "secondMethod" so I can write my class in a
logical order and not in a "methods call priority order".

Yes - declare your private methods separately, as a category.

For example; assuming you have declared your public methods elsewhere, you could declare a "PrivateMethods" category for your private methods like this:

@interface MyClass(PrivateMethods)
// Method declarations here...
@end

You can put this additional interface at the top of the .m file, or in a separate header file - whatever suits your purposes best.

sherm--

C programmers never die - they're just cast into void.
_______________________________________________
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: 
 >Pre declaration of methods (From: Jérôme Paschoud <email@hidden>)

  • Prev by Date: Re: Native Cocoa vs Java performance question
  • Next by Date: Re: cocoa-dev digest, Vol 2 #2170 - 3 msgs
  • Previous by thread: Pre declaration of methods
  • Next by thread: Re: cocoa-dev digest, Vol 2 #2170 - 3 msgs
  • Index(es):
    • Date
    • Thread