viewDidLoad and KVO

2014-06-05 Thread Rick Mann
I often have a view controller that displays a view associated with a model object. So, I'll have a foo property on that VC, and in the prepareForSegue call that presents the VC, I'll setFoo on it. In my -setFoo: method, I set up KVO on the properties of the foo that I'm interested in

Re: viewDidLoad and KVO

2014-06-05 Thread Lee Ann Rucker
In my -setFoo: method, I set up KVO on the properties of the foo that I'm interested in displaying. In the -observe... method, I update the various bits of UI as properties change. If you're doing something like this: - (void)setFoo: (Foo *)aFoo { [foo removeObserver:self

Re: viewDidLoad and KVO

2014-06-05 Thread Rick Mann
On Jun 5, 2014, at 00:26 , Lee Ann Rucker lruc...@vmware.com wrote: If you're doing something like this: - (void)setFoo: (Foo *)aFoo { [foo removeObserver:self forKeyPath:@whatever...]; foo = aFoo; [foo addObserver:self forKeyPath:@whatever...; } we used that pattern for a while

Re: Drawing custom contiguous selection highlight in view-based NSOutlineView

2014-06-05 Thread Michael Starke
On 05 Jun 2014, at 05:18, Graham Cox graham@bigpond.com wrote: On 5 Jun 2014, at 12:54 pm, Lee Ann Rucker lruc...@vmware.com wrote: It does? When I saw your subject line I thought you were were talking about SourceView style, because I have one - it's view-based - and I'd been

Re: Drawing custom contiguous selection highlight in view-based NSOutlineView

2014-06-05 Thread Graham Cox
On 5 Jun 2014, at 7:42 pm, Michael Starke michael.sta...@hicknhack-software.com wrote: Take a look at the tool you daily use :) Xcode has continuous background gradients in it's source-list style OutlineView Good call :) well, that shows exactly what I'm talking about... but also suggests

Re: viewDidLoad and KVO

2014-06-05 Thread Alejandro Visiedo García
Why don't you use viewWillAppear and viewDidDisappear, to register and unregister observers to your foo property object? If you don't use ARC, be carefull to unregister on dealloc too! El 05/06/2014, a las 09:30, Rick Mann rm...@latencyzero.com escribió: On Jun 5, 2014, at 00:26 , Lee Ann

Re: viewDidLoad and KVO

2014-06-05 Thread Graham Cox
On 5 Jun 2014, at 3:03 pm, Rick Mann rm...@latencyzero.com wrote: I can solve this by doing an explicit UI update step in -viewDidLoad, but that ends up effectively duplicating the UI update code. I can load the view in -setFoo: by referencing self.view, but this seems like a hack.

Re: Drawing custom contiguous selection highlight in view-based NSOutlineView

2014-06-05 Thread Lee Ann Rucker
Take a look at the tool you daily use :) Xcode has continuous background gradients in it's source-list style OutlineView Yeah, but we all know Apple gets to cheat :) - Original Message - From: Michael Starke michael.sta...@hicknhack-software.com To: cocoa-dev cocoa-dev@lists.apple.com

Re: Drawing custom contiguous selection highlight in view-based NSOutlineView

2014-06-05 Thread Jonathan Mitchell
On 5 Jun 2014, at 14:03, Graham Cox graham@bigpond.com wrote: On 5 Jun 2014, at 7:42 pm, Michael Starke michael.sta...@hicknhack-software.com wrote: Take a look at the tool you daily use :) Xcode has continuous background gradients in it's source-list style OutlineView Good

Re: viewDidLoad and KVO

2014-06-05 Thread Rick Mann
On Jun 5, 2014, at 06:26 , Alejandro Visiedo García alejandro.visi...@gmail.com wrote: Why don't you use viewWillAppear and viewDidDisappear, to register and unregister observers to your foo property object? If you don't use ARC, be carefull to unregister on dealloc too! That, combined

Simple question? NSButton/checkbox color

2014-06-05 Thread Alex Kac
I’m still learning AppKit after many years on iOS :) Given an NSButton based checkbox…what’s the best way to get a colored check? I think we’re just going to have to use a custom image that we create - which is fine just annoying as we’ll also have to match Yosemite - but if there is a better

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread SevenBits
On Jun 5, 2014, at 8:32 PM, Alex Kac a...@webis.net wrote: I’m still learning AppKit after many years on iOS :) Given an NSButton based checkbox…what’s the best way to get a colored check? I think we’re just going to have to use a custom image that we create - which is fine just annoying

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread Kyle Sluder
On Jun 5, 2014, at 5:38 PM, SevenBits sevenbitst...@gmail.com wrote: On Jun 5, 2014, at 8:32 PM, Alex Kac a...@webis.net wrote: I’m still learning AppKit after many years on iOS :) Given an NSButton based checkbox…what’s the best way to get a colored check? I think we’re just going to

Re: Simple question? NSButton/checkbox color

2014-06-05 Thread Alex Kac
OK maybe I’m not being clear. We need to have a checkbox that can be colored, exactly the same way that the Calendar app on both color their checkboxes for the calendar they are representing. Right now the only way I can think of doing that is to create a checkbox image, and color it, and use