NSMenuItem addTarget & retain
NSMenuItem addTarget & retain
- Subject: NSMenuItem addTarget & retain
- From: Remko Tronçon <email@hidden>
- Date: Tue, 4 Aug 2009 10:46:18 +0200
Hi,
Is the following piece of code legal?
Foo* foo = [[Foo aloc] init];
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: @"Item" action:
@selector(action:) keyEquivalent: @""];
[item setTarget: foo];
[foo release];
Unless I have a problem in some other part of my code, it seems that
releasing the 'foo' object is not allowed. In my limited knowledge of
Cocoa, I would expect that NSMenuItem retains foo. Is this a wrong
assumption?
thanks,
Remko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden