Re: Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.
Re: Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.
- Subject: Re: Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments.
- From: Søren Krogh Neigaard <email@hidden>
- Date: Wed, 3 Dec 2008 21:39:48 +0100
Thank you both for explaining this :-)
Med venlig hilsen/Best regards
Søren Krogh Neigaard
On 03/12/2008, at 20.03, Andy Lee <email@hidden> wrote:
On Dec 3, 2008, at 1:38 PM, Søren Krogh Neigaard wrote:
So it seems somehow it can not identify my method, even though it
is in the same class. Im a Java person, what I really wanted is
just a private method here??
Ken gave a good answer, but to elaborate on some differences between
Objective-C and Java methods:
* Unlike in Java, you can't declare a method anywhere and have the
whole class know about it. The compiler has to have seen the method
either declared or defined before you call the method, otherwise
you'll get warnings.
* In Objective-C, you typically have separate declaration and
definition for a method that you want to advertise. The declaration
goes in the .h file, and the definition (implementation) goes in
the .m file. This is unlike Java where there is no such thing as a
separate declaration.
* In Objective-C, methods can't be truly private, only
unadvertised. You can send any message you want to any object you
want (possibly generating a compiler warning at worst), and at
runtime if the object implements that method, regardless of any
attempts to hide this fact, the method will be called.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden