Re: Get controller from nib
Re: Get controller from nib
- Subject: Re: Get controller from nib
- From: James Maxwell <email@hidden>
- Date: Tue, 18 May 2010 18:07:48 -0700
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 itself. I'm going to poke away at this for a bit. Sorry for the spam.
J.
On 2010-05-18, at 5:42 PM, James Maxwell wrote:
> 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 MIDIInstrument has to respond to the selection made in the table). So, if I do that, and make the connections to Central_MIDI_Controller, as recommended, will the NSArrayController be able to add new instances of MIDIInstrument (and new rows to my table), which also have these connections? As I mentioned, I need an arbitrary number of MIDIInstruments.
>
> Kind of confused about this...
>
> thanks in advance.
>
> J.
>
>
> On 2010-05-18, at 5:26 PM, James Maxwell wrote:
>
>> 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.nib file?
>>>
>>> You can add an outlet to your app controller object pointing to that controller object, and then add an accessor method that returns it.
>>>
>>> @interface MyAppController : NSObject
>>> {
>>> IBOutlet Central_MIDI_Controller* _midiController;
>>> }
>>> @property Central_MIDI_Controller* midiController;
>>> @end
>>>
>>>
>>> @implementation MyAppController
>>> @synthesize midiController = _midiController
>>> @end
>>>
>>> Then just wire up _midiController in IB.
>>>
>>> —Jens
>>
>> James B Maxwell
>> Composer/Doctoral Student
>> School for the Contemporary Arts (SCA)
>> School for Interactive Arts + Technology (SIAT)
>> Simon Fraser University
>> email@hidden
>> email@hidden
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> James B Maxwell
> Composer/Doctoral Student
> School for the Contemporary Arts (SCA)
> School for Interactive Arts + Technology (SIAT)
> Simon Fraser University
> email@hidden
> email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
James B Maxwell
Composer/Doctoral Student
School for the Contemporary Arts (SCA)
School for Interactive Arts + Technology (SIAT)
Simon Fraser University
email@hidden
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden