Re: Get controller from nib

2010-05-27 Thread Reinhard Segeler
Hi James, today I read your mail: I ran into a problem with the reference some time ago. I have solved it by posting/observing a notification with the reference as the only object in the userInfo dict.. That works fine and assures, that the reference can be determined exactly. The only pro

Re: Get controller from nib

2010-05-20 Thread James Maxwell
So, I decided to get rid of the NSArrayController, since it was driving me slightly crazy, and just do this manually. I've got the table **appearing** as I'd like it to, but I can't change the selection. There are 3 columns: 1) string, 2) NSPopUpButtonCell for MIDI ports, and 3) NSPopUpButtonCel

Re: Get controller from nib

2010-05-19 Thread James Maxwell
oh jeez... This is making me crazy. For some reason, my NSArrayController appears to be calling "count" on MIDIInstrument objects. No idea why. I could see it calling count on the array it's controlling, but not an object in that array. Has anyone come across this problem? I have a MIDI_Instru

Re: Get controller from nib

2010-05-19 Thread James Maxwell
okay, going slightly nuts. I've implemented my MIDI_Instrument_Controller object, and hooked it up to my table view, but it's complaining about implementing numberOrRowsInTableView and tableView:objectValueForTableColumn:row:. Fine, except that I very definitely have implemented them. I tried c

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James! On 18/May/2010, at 5:42 PM, James Maxwell wrote: > Okay, getting a bit deeper into this, I realize I'm still "in the woods", so > to speak. I'm going to have to hook up my NSTableView to set the *selected* > port and channel for the MIDIInstruments, which means it's pretty much going

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James! On 18/May/2010, at 5:26 PM, James Maxwell wrote: > Anyway, I do like the sound of your design... So, does the instance loaded in > IB become a one-off, or does it somehow "alias" (for lack of a better word) > all future instances? I was under the impression that the instance in IB was

Re: Get controller from nib

2010-05-18 Thread James Maxwell
okay, there seems to be a big design flaw here... I think this will all be simpler if I have a separate MIDI_Instrument_Controller, loaded in the nib, which can deal with the table and the Central_MIDI_Controller. Then I'll let the NSArrayController deal with instances of the MIDIInstrument itse

Re: Get controller from nib

2010-05-18 Thread James Maxwell
ugh... Okay, getting a bit deeper into this, I realize I'm still "in the woods", so to speak. I'm going to have to hook up my NSTableView to set the *selected* port and channel for the MIDIInstruments, which means it's pretty much going to have to be loaded in the nib after all (since the MIDII

Re: Get controller from nib

2010-05-18 Thread James Maxwell
Yes, this is basically what I've done, and it does seem to work... On 2010-05-18, at 4:49 PM, Jens Alfke wrote: > > On May 18, 2010, at 4:28 PM, James Maxwell wrote: > >> I know this is probably really simple, but how do I grab a reference to a >> controller object loaded only in the MainMenu.

Re: Get controller from nib

2010-05-18 Thread James Maxwell
Hey Mark, Thanks for this, but it points out one confusion i have. If I thought it would be fine to just have MIDIInstrument in the nib, everything would be simple. But my (mis)understanding was that putting the MIDIInstrument in the nib would only apply to that single instance. Is that not cor

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James! On 18/May/2010, at 5:00 PM, James Maxwell wrote: > From the MIDIInstrument init, I can run [[NSApp delegate] midiController] and > get the instance of Central_MIDI_Controller loaded in the nib. As I say, it > feels a bit hackish. Though it does work, and advice is still welcome. Sure

Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
On 18/May/2010, at 4:28 PM, James Maxwell wrote: > What I'm not understanding is how to allow newly created MIDIInstrument > objects to read the available/enabled ports from Central_MIDI_Controller. I > know this is probably really simple, but how do I grab a reference to a > controller object l

Re: Get controller from nib

2010-05-18 Thread James Maxwell
okay, so I kind of hacked around it. I gave my AppController (which is a delegate of File's Owner) an outlet for the Central_MIDI_Controller, and hooked that up in IB. Then I also gave the AppController an accessor for "midiController", that returns the reference to Central_MIDI_Controller conn

Re: Get controller from nib

2010-05-18 Thread Jens Alfke
On May 18, 2010, at 4:28 PM, James Maxwell wrote: > I know this is probably really simple, but how do I grab a reference to a > controller object loaded only in the MainMenu.nib file? You can add an outlet to your app controller object pointing to that controller object, and then add an access