On Fri, Aug 29, 2008 at 12:32 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > When you use the id<protocol> syntaxt, the compiler assume your object only > implements the method declared in your protocol. > If you want to use some other function, you have to use an object type that > declare thoses functions, for example in your case, NSObject. >
However, NSObject is both a class and a protocol. Although most classes inherit from NSObject, this is not always the case (for example, using DO, where objects inherit from the NSProxy root class). It's preferrable if your protocol incorporates the NSObject protocol as well, which enforces all implementors to also conform to the NSObject protocol (and you take an id<MyProtocol>)---because you don't actually care if you have an NSObject subclass, just that whatever you've got behaves like an NSObject. Phil _______________________________________________ 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 [EMAIL PROTECTED]