Re: NSTreeNode/representedObject
Re: NSTreeNode/representedObject
- Subject: Re: NSTreeNode/representedObject
- From: David Riggle <email@hidden>
- Date: Fri, 9 Nov 2007 13:44:01 -0800
Never mind, I figured it out: item is now a subclass of NSTreeNode.
Here's the new code.
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:
(id)item
{
id myObject = LEOPARD_OR_LATER ? [item representedObject] : [item
observedObject];
[myObject setExpanded:NO];
return YES;
}
On Nov 9, 2007, at 10:03 AM, David Riggle wrote:
Can somebody explain how we're supposed to use the new NSTreeNode/
representedObject to replace the NSOutlineView observedObject hack
that was so darned convenient? The following code
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:
(id)item
{
id myObject = [item observedObject];
[myObject setExpanded:NO];
return YES;
}
now produces an error message on the console:
WARNING: Using deprecated NSTreeController internal API. Break on
'observedObject' to debug. Use of this method should be replaced by
NSTreeNode/representedObject
_______________________________________________
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