From my understanding the delegating class is the one which always inherits from NSResponder
class and delegate
is only available to classes that inherits from NSResponder
. NSMenu
inherits directly from NSObject
, so then why do i see deletgate
in the outlets
?
Or is it that i misunderstood the options that you see after ctrl-click on an object in Interface Builder? I see Outlets
, Referencing outlets
, Received Actions
, what does these mean then?
I am using Xcode 4 (10.7.3), if that matters.
Asked
Active
Viewed 254 times
0

JamesWebbTelescopeAlien
- 3,547
- 2
- 30
- 51
1 Answers
0
I have no idea where you saw this but it's completely and totally incorrect. Delegation is just a pattern, there are no restrictions on the type of objects that can implement a delegate.
In fact, you are encouraged to use the delegation pattern in your own classes.
NSMenu
declares its delegate
property as an outlet in the header, which is why you see it in Interface Builder. You can do the same in your own code like so:
@interface YourObject : NSObject {}
@property (weak) IBOutlet id delegate;
@end
In Interface Builder, Outlets
refers to the outlets that are defined in your class's header and that you can connect to other objects. Referencing Outlets
and Referencing Actions
connections from other objects to your object.

Rob Keniger
- 45,830
- 6
- 101
- 134
-
Now going back to apples documentation i realized that i was wrong, i didnt read "often" word in it. `The delegating object is often a responder object—that is, an object inheriting from NSResponder in AppKit or UIResponder in UIKit—that is responding to a user event. The delegate is an object that is delegated control of the user interface for that event, or is at least asked to interpret the event in an application-specific manner.` – JamesWebbTelescopeAlien Feb 25 '12 at 02:32