Re: Figuring out which values are selected in an NSTableView
Re: Figuring out which values are selected in an NSTableView
- Subject: Re: Figuring out which values are selected in an NSTableView
- From: Denis Stanton <email@hidden>
- Date: Wed, 18 May 2005 19:25:12 +1200
On May 18, 2005, at 6:42 PM, mmalcolm crawford wrote:
On May 17, 2005, at 11:21 PM, Denis Stanton wrote:
I have that IBOutlet and I have dragged from File's Owner to
NSArrayControler and clicked connect so I see Source:
paymentController, Destination: NSArray Controller. I also have
Source: window Destination:NSWindow(Window).
And yet [paymentController selectedObjects] remains null
Are you sure that paymentController itself is not nil when you call
the method?
It's quite possible I'm getting fixated on this and am missing
something else obvious, but that currently seems like the simplest
answer. Have you implemented a -setPaymentController: method that
something else calls?
It's as if there are two paymentControllers, the one the IBOutlet is
bound to and the one I am interrogating.
Have you implemented an init or other method that creates a new
NSArrayController?
No, but you're close. As has become obvious, it's my fault.
It turns out that when I first defined my paymentController I typed
IBOutlet NSArrayController *PaymentController;
(note the subtle difference)
This name was accepted by IB.
I subsequently corrected the .h file to
IBOutlet NSArrayController *paymentController;
but IB remained connected to PaymentController
I thought I had re-synched the .h and the nib file several times, but I
missed this.
This time when I dragged MyDocument.h onto MyDocument.nib it asked me
if I wanted to overwrite or merge. I clicked merge but the merge
program didn't come up (I still don't know why but that's another
story). After fiddling with this for a while I noticed I had acquired
outlets for both PaymentController and paymentController. After that
it was a matter of deleting anything suspect, forcing an overwrite and
reconnecting.
Thank you for your patience. I was looking for a a logical omission
when the problem was down to bad typing, and then not noticing the case
change. i have a sneaking suspicion that IB/Xcode was partially fooled
by the case change too as it didn't seem to notice the discrepancy when
compiling, but it would be unfair of me to try and shift the blame for
my mistake
regards
Denis
Denis Stanton
Orcon Internet Limited
(09) 480 9299
http://www.orcon.net.nz
_______________________________________________
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