• 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: Are method declarations just comments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are method declarations just comments?


  • Subject: Re: Are method declarations just comments?
  • From: Chris Gehlker <email@hidden>
  • Date: Mon, 09 Jul 2001 13:09:54 -0700

On 7/9/01 11:07 AM, "Peter Ammon" <email@hidden> wrote:

> on 7/8/01 2:27 AM, Andreas Monitzer at email@hidden wrote:
>
>> On Sunday, July 8, 2001, at 08:52 , Chris Gehlker wrote:
>>

>> Header files are in ObjC (like in C, unlike in C++) just a hint for the
>> compiler and for the user. You can send every message you like to every
>> object, but if it's not declared in the header, the compiler will spit out
>> a warning.
>
> Unless I'm mistaken, Objective-C is actually more lax about requiring
> function declarations. For example, C requires that variadic functions
> (that is, functions with a variable number of arguments like printf) be
> prototyped, whereas AFAIK Objective-C places no such requirements on
> variadic methods (e.g. arrayWithObjects:)


It seems that if you only invoke a method from the file where you defined
it, the compiler won't notice if you forgot to declare it. Once you invoke
it from a second file, the compiler notices that it wasn't declared and
issues warning every place you mention it.
--
Every society honors its live conformists and its dead troublemakers.
-Mignon McLaughlin, author


References: 
 >Re: Are method declarations just comments? (From: Peter Ammon <email@hidden>)

  • Prev by Date: Re: Java and Cocoa - NSTableView and NSOutlineView
  • Next by Date: RE: Java and Cocoa - NSTableView and NSOutlineView
  • Previous by thread: Re: Are method declarations just comments?
  • Next by thread: Re: Are method declarations just comments?
  • Index(es):
    • Date
    • Thread