On Tue, Aug 5, 2008 at 12:18 PM, James Bucanek <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote (Tuesday, > August 5, 2008 5:41 AM +0100): >> >> My superclass (SuperSocket) provides a private method -close. > > Others have adiquetly explained the whole 'self' vs. 'super' issue, but this > statement still has me stumped and I'm wondering why this even came up. > > There is no such thing as a "private" method in Objective-C. The @private, > @protected, @public keywords only work on instance variables. So if the > super class implements -close, there should never be anything stopping your > subclass from simply calling [super close].
True however... It could be that he has a method defined in a class continuation (Objective-C 2.0) or private category in an implementation file. This would result in subclasses not seeing the methods declaration. So if the subclass attempts to send such a method at a minimum the compiler may warn about it not responding to that method (depends on the packaging of the super class in question) and at worst the compiler could emit a call chain that incorrectly passes parameters and/or fetches the return value as result of incorrect assumptions about parameter/return types (should see a warning as well). -Shawn _______________________________________________ Cocoa-dev mailing list ([email protected]) 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]
