Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTreeNode/representedObject



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.