• 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
More NSBrowser/NSTreeController bugs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More NSBrowser/NSTreeController bugs


  • Subject: More NSBrowser/NSTreeController bugs
  • From: Hamish Allan <email@hidden>
  • Date: Sun, 4 Dec 2005 17:02:32 +0000

Firstly, I'd like to ask if anyone out there apart from me is actually using NSBrowser with NSTreeController? Is anyone at Apple even working on the code? Is it worth my while developing code which uses NSBrowser bindings, or should I just stick to the old way of doing things?

In a previous post about a different NSTreeController bug, I linked to a test project which binds an NSOutlineView and an NSBrowser to a model of the filesystem. In my continued attempt to add icons to a bound NSBrowser, I have updated this project to use custom cells. In this bug example, the only method I have overridden is setObjectValue, just to log what is passed, e.g.:

- (void)setObjectValue:(id)value
{
NSLog(@"-[TestBrowserCell setObjectValue:(%@)%@]", [value class], value);
[super setObjectValue:value];
}
(The equivalent also exists in TestTextFieldCell.)

The project is here:

http://igor.gold.ac.uk/~map01ra/BindTest2.zip

For comparison (and to determine that this is not just a plain NSBrowser bug), I have also written a version which uses the old school of NSBrowser delegate methods (somewhat inefficiently, and without the selected index bindings):

http://igor.gold.ac.uk/~map01ra/BindTest2Unbound.zip

Running the bindings version, I get:

[Session started at 2005-12-04 13:18:12 +0000.]
2005-12-04 13:18:14.442 BindTest[14749] -[TestBrowserCell setObjectValue:(NSCFString)]

Adding an item to the master interface, I get:

2005-12-04 13:18:18.078 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.080 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2).DS_Store]
2005-12-04 13:18:18.082 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.084 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2).hotfiles.btree]
2005-12-04 13:18:18.085 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.086 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2).Spotlight-V100]
2005-12-04 13:18:18.089 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.090 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2).Trashes]
2005-12-04 13:18:18.092 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.107 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2).vol]
2005-12-04 13:18:18.109 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.111 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2)Applications]
2005-12-04 13:18:18.143 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.144 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2)automount]
2005-12-04 13:18:18.146 BindTest[14749] -[TestTextFieldCell setObjectValue:((null))(null)]
2005-12-04 13:18:18.153 BindTest[14749] -[TestTextFieldCell setObjectValue:(NSPathStore2)bin]

Apart from the inefficiency of the extra call with null argument, this is fine: these are the eight objects visible in the outline view. But where are the calls to -[TestBrowserCell setObjectValue:]? The NSBrowser is nonetheless being populated! But what's really odd is that if you browse to e.g. Applications, I get -[TestBrowserCell setObjectValue:] called for every item in /Applications -- not just the visible ones!

In contrast, with the unbound (delegate) version, I get - [TestBrowserCell setObjectValue:] called as you would expect:

2005-12-04 16:30:40.328 BindTest[16277] -[TestBrowserCell setObjectValue:(NSCFString)]
2005-12-04 16:30:40.580 BindTest[16277] -[TestBrowserCell setObjectValue:(NSCFString) ]

(well, okay, these two extraneous calls are not quite what you would expect, but they are manageable)

2005-12-04 16:30:59.181 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).DS_Store]
2005-12-04 16:30:59.186 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).hotfiles.btree]
2005-12-04 16:30:59.189 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).Spotlight-V100]
2005-12-04 16:30:59.192 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).Trashes]
2005-12-04 16:30:59.194 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).vol]
2005-12-04 16:30:59.195 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)Applications]
2005-12-04 16:30:59.196 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)automount]
2005-12-04 16:30:59.197 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)bin]
2005-12-04 16:30:59.199 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)cores]

(select Applications):

2005-12-04 16:31:01.503 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).DS_Store]
2005-12-04 16:31:01.505 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2).localized]
2005-12-04 16:31:01.508 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)Accessorizer.app]
2005-12-04 16:31:01.512 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)Acquisition.app]
2005-12-04 16:31:01.514 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)Address Book.app]
2005-12-04 16:31:01.519 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)AntiRSI.app]
2005-12-04 16:31:01.523 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)AppleScript]
2005-12-04 16:31:01.528 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)AquaTerm.app]
2005-12-04 16:31:01.530 BindTest[16277] -[TestBrowserCell setObjectValue:(NSPathStore2)Audacity-macosx-1.2.3]

i.e. it works just fine.

I have reported this bug to Apple, but you never get any feedback on priority or anything like that, and right now I feel like I am alone in the world using NSBrowser bindings. Anyone?!

Thanks,
Hamish

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: More NSBrowser/NSTreeController bugs
      • From: John Buckley <email@hidden>
    • Repost: More NSBrowser/NSTreeController bugs
      • From: Hamish Allan <email@hidden>
  • Prev by Date: Using MoreSecurity Asynchronously?
  • Next by Date: Bindings / CoreData / two windows issue
  • Previous by thread: Using MoreSecurity Asynchronously?
  • Next by thread: Repost: More NSBrowser/NSTreeController bugs
  • Index(es):
    • Date
    • Thread