• 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: Protocol doesn't seem to compile?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Protocol doesn't seem to compile?


  • Subject: RE: Protocol doesn't seem to compile?
  • From: "Jason Vowell" <email@hidden>
  • Date: Fri, 27 Feb 2004 08:32:35 -0600

Yes of course it is checked if referenced by an implementing class, per my
post


"If I make a syntax mistake
the compiler ignores it, unless of course the protocol is
referenced by an implementing class."

And of course the apple documentation says this as well

But that isn't the point... the point is that they aren't check if not
referenced

Jason

-----Original Message-----
From: email@hidden
[mailto:email@hidden] On Behalf Of Ondra Cada
Sent: Friday, February 27, 2004 5:00 AM
To: email@hidden
Cc: email@hidden
Subject: Re: Protocol doesn't seem to compile?

Jason,

On Friday, Feb 27, 2004, at 02:42 Europe/Prague,
email@hidden wrote:

> I find it very odd that the syntax of a declared
> protocol is not checked by the compiler unless the protocol has been
> implemented, and thus referenced, by a class.

I am sorry, but it very definitely is checked--see the line number in
the following plain example:

59 /tmp> >ptest.m
#import <Foundation/Foundation.h>
@protocol Test
-(int)foo;
-bar:(uh oh)o; // this is a syntax error, of course
@end

@interface Test:NSObject <Test>
@end

@implementation Test
-(int)foo {return 0;}
-bar:o {return nil;}
@end
60 /tmp> cc -framework Foundation ptest.m
ptest.m:4: undefined type, found `uh'
ptest.m:4: illegal keyword selector, missing `)' after `uh'
cpp-precomp: warning: errors during smart preprocessing, retrying in
basic mode
ptest.m:4: parse error before "uh"
61 /tmp>

---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.
_______________________________________________
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: 
 >Re: Protocol doesn't seem to compile? (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Extending NSMutableDictionary what am I doing wrong?
  • Next by Date: RE: Protocol doesn't seem to compile?
  • Previous by thread: Re: Protocol doesn't seem to compile?
  • Next by thread: RE: Protocol doesn't seem to compile?
  • Index(es):
    • Date
    • Thread