Le 16 mars 09 à 13:04, Mike Abdullah a écrit :


On 16 Mar 2009, at 11:43, Jean-Daniel Dupas wrote:


Le 16 mars 09 à 12:22, Jeremy Pereira a écrit :


On 14 Mar 2009, at 04:27, Roland King wrote:


As NSObject is also a protocol you could probably also do

id <NSObject, Protocol> to say the object supports NSObject and Protocol methods but I never do, partly because it doesn't seem as clear, partly because I know that I'm always going to pass something which is actually descended from NSObject, not just supporting that protocol and partly because the NSObject protocol doesn't have some of the NSObject methods I often end up using.

Or you can define your protocol as extending the NSObject protocol. e.g.

@protocol Foo <NSObject>

// Methods

@end


No, you can't, else the compiler will complains if you do not override all NSObject protocol methods in classes that conform to the Foo protocol.

No it shouldn't. The compiler should only complain if your class does not implement those methods, which of course it does as it inherits from NSObject.


I don't know if it should or not, but it does.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to