• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)


  • Subject: Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
  • From: Jonathan Dann <email@hidden>
  • Date: Sat, 12 Jan 2008 18:46:27 +0000

Hi Guys,

Probably not one of their most pressing matters, but should I file a radar with a simple fix for a bug in one of Apple's sample codes? Is it useful for them, as I'm sure loads of developers look at this particular sample code?

It's the one called SourceView, which shows how to build up a sample source list à la iTunes. The drag and drop method has an error.

// myWindowController.m
// -handleInternalDrops:

NSInteger i;
for (i = ([newNodes count] - 1); i >=0; i--)
{
[treeController moveNode:[newNodes objectAtIndex:i] toIndexPath:indexPath];
}


should read:

NSEnumerator *enumerator = [newNodes reverseObjectEnumerator]
NSMutableArray *reverseDragArray = [[NSMutableArray alloc] init];
	for(id item in enumerator)
		[reverseDragArray addObject:item];

[treeController moveNodes:reverseDragArray toIndexPath:indexPath];

Their way means the dragged nodes end up all over the place when dragging into a group (folder) as the indexPath is not updated after each node is moved. Obviously I've use fast enumeration to clean it up too, but the idea is to not move the nodes one at a time!

Other than that its great sample code if you want the iTunes look and need to work out using NSOutlineView, NSTreeController and Bindings, check it out:

http://developer.apple.com/samplecode/SourceView/index.html

Jonathan

_______________________________________________

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


  • Follow-Ups:
    • Re: Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
      • From: j o a r <email@hidden>
    • Re: Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: Creating a class from files
  • Next by Date: Re: Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
  • Previous by thread: How to use "setRecentSearches" of a NSSearchField?
  • Next by thread: Re: Reporting Bugs in Apple Sample Code (NSOutlineView, NSTreeController and Bindings)
  • Index(es):
    • Date
    • Thread