• 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
Re: I think I have found a big bug in NSBrowser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I think I have found a big bug in NSBrowser


  • Subject: Re: I think I have found a big bug in NSBrowser
  • From: Andre <email@hidden>
  • Date: Thu, 26 Jan 2006 10:00:16 -0800

7:43, Hamish Allan wrote:


On Wed, 25 Jan 2006 19:03:18 -0800, email@hidden wrote:

I found something interesting, maybe its a bug, or maybe I'm just dumb, but....

Setting the custom cell to an NSBrowser works as long as it doesn't use bindings.
Manually be a data source to the NSBrowser, and the custom cell that is set at - awakeFromNib and it sticks.
Setting it at the same time but hooking the browser to an NSTreeController, and it all goes south.


What am I doing wrong? Heres a really simple example app. http:// homepage.mac.com/son_gohan/sites/BrowserCell.zip

I think that URL should be http://homepage.mac.com/son_gohan/ BrowserCell.zip


Your NSTreeController has no content array, so it's difficult to tell what you mean by "it all goes south".
What I meant was that it intermittently used my subclass, and at other times used the normal NSBrowserCell.
If the bindings are all connected to the NSTreeController (its set to use NSDictionary so thats the content),
then it becomes near impossible to set the class correctly. I've noticed that setting it, it sticks when doing print object on
the browser, but after the awakeFromNib method exits, it reverts to NSBrowserCell.


The way I had the example set up was with the delegate just returning an arbitrary number of rows (5) to demonstrate
it working, but if one bound the NSTreeController up to the Browser, then the cell setting doesn't stay, or at least becomes intermittent.
(This was visible from the NSLog statement)


Heres a pic with the log statement out put and the browser after hooking up the NSTreeController:http://homepage.mac.com/son_gohan/ pic3.png

The following may be of use to you -- subclass NSBrowser and override:

- (id)initWithCoder:(NSCoder *)decoder
{
	if ((self = [super initWithCoder:decoder]))
		[self setCellClass:[CustomCell class]];
	return self;
}
Yes, it now works correctly, even when used with the NSTreeController.
But should I have to subclass to get this right?

Thanks for your help!

Best wishes,
Hamish


Andre email@hidden



_______________________________________________
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: I think I have found a big bug in NSBrowser
      • From: Hamish Allan <email@hidden>
References: 
 >Re: I think I have found a big bug in NSBrowser (From: Hamish Allan <email@hidden>)

  • Prev by Date: Are there any NSUserDefaults keys which aren't valid?
  • Next by Date: Re: Bindings or datasource for a large NSTableView
  • Previous by thread: Re: I think I have found a big bug in NSBrowser
  • Next by thread: Re: I think I have found a big bug in NSBrowser
  • Index(es):
    • Date
    • Thread