[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PATCH: Find more ObjC methods
From: |
Ziemowit Laski |
Subject: |
Re: PATCH: Find more ObjC methods |
Date: |
Fri, 3 Oct 2003 11:44:57 -0700 |
On Friday, Oct 3, 2003, at 02:57 US/Pacific, David Ayers wrote:
Markus Hitter wrote:
Am Freitag, 03.10.03 um 04:10 Uhr schrieb Alexander Malmberg:
Ziemowit Laski wrote:
[snip]
in the long run, the compiler should stop distinguishing
@interfaces from
@implementations (since the former are merely forward declarations
for the latter).
I've always considered this a feature. The @interface is the public
interface for an @implementation. Thus, methods that appear only in
an implementation are private to that implementation.
It will stay there as a feature unless you get rid of header files at
all and #include the whole source when using a library.
That's surely not what Zem meant :-)
When the compiler parses the source, it keeps track of what it sees.
Currently it keeps track of methods encountered in @interface
declarations seperate from the current @implementation declaration.
Yes, exactly. :-)
Example:
@interface Foo
-(void)somePublicMethod;
@end
@implementation Foo
-(void)somePublicMethod {};
-(void)somePrivatMethod {};
-(void)someOtherPrivateMethod
{
[self somePrivateMethod];
}
@end
@implementation Foo (aCategory)
-(void)somePrivatCategoryMethod {};
-(void)someOtherCategoryMethod
{
[self somePrivatCategoryMethod];
[self somePrivatMethod]; /* <- should not see the prototype and warn!
*/
}
@end
No, here is where I disagree. Clearly, the compiler has seen the
@implementation containing the method in question, so it knows it is
there. Not sure why you'd want the compiler to look the other way? :-)
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477
- PATCH: Find more ObjC methods, Ziemowit Laski, 2003/10/02
- Re: PATCH: Find more ObjC methods, Alexander Malmberg, 2003/10/02
- Re: PATCH: Find more ObjC methods, Markus Hitter, 2003/10/03
- Re: PATCH: Find more ObjC methods, Alexander Malmberg, 2003/10/05
- Re: PATCH: Find more ObjC methods, Devang Patel, 2003/10/06
- Re: PATCH: Find more ObjC methods, Ziemowit Laski, 2003/10/06
- Re: PATCH: Find more ObjC methods, Alexander Malmberg, 2003/10/06
- Re: PATCH: Find more ObjC methods, Ziemowit Laski, 2003/10/06
- Re: PATCH: Find more ObjC methods, Pete French, 2003/10/07
- Re: PATCH: Find more ObjC methods, David Ayers, 2003/10/07
- Re: PATCH: Find more ObjC methods, Devang Patel, 2003/10/07