Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-11 Thread Steven Hamilton
Great stuff. Thanks Guys. What I've done is register as an observer of the arrangedObjects keypath in my windowDidLoad method. Then when it changes I set the correct selectedIncomeEnvelope and remove the observer. Job done. On 09/12/2008, at 9:51 PM, Volker in Lists wrote: Hi Steven, as

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-09 Thread Volker in Lists
Hi Steven, as far as I know, the fect happens in the next run loop. So you would need to set the selection then. This is possible for example via the performSelector:withObject:afterDelay: and a delay of 0.0 on self (?). Cheers, Volker Ah, I understand. I've implemented the correc

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-09 Thread Steven Hamilton
> > However, the arrangedObjects array, while existing, contains zero > objects. I've checked the Outlet is connected ok. A timing issue of > some sort? No. Based on the above, your code isn't KVO compliant. First of all, it's important to realize that nothing is ever bound to an instance vari

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-08 Thread Quincey Morris
On Dec 8, 2008, at 04:18, Steven Hamilton wrote: I have a custom NSWindowController called budgetController. Interface thus (cropped a bit) @interface MLBudgetController : NSWindowController { IBOutlet NSArrayController *incomeEnvelopeController; NSManagedObject *selectedInco

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-08 Thread Steven Hamilton
Hi folks, I've got a single NSPopupButton. The content is bound to an NSArrayController arrangedObjects and value bound an attribute. All good. THe ArrayController is sourcing a Core Data store for its array and this is all good too. The problem is when the window is loaded the NSPopupButton is sh

NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-08 Thread Steven Hamilton
Hi folks, I've got a single NSPopupButton. The content is bound to an NSArrayController arrangedObjects and value bound an attribute. All good. THe ArrayController is sourcing a Core Data store for its array and this is all good too. The problem is when the window is loaded the NSPopupButt