Re: NSArrayController, TableView and not showing data
Re: NSArrayController, TableView and not showing data
- Subject: Re: NSArrayController, TableView and not showing data
- From: Keary Suska <email@hidden>
- Date: Wed, 05 Jul 2006 19:08:38 -0600
- Thread-topic: NSArrayController, TableView and not showing data
on 7/5/06 6:34 PM, email@hidden purportedly said:
(edited for relevancy)
>> This is alloc'ed and loaded with data on launch and contains 1 item.
>>
>> Binding (contentArray) points to pluginInstances in my AppController
>>
>> So... When I first bring up the tableView, there is nothing in it (although
>> the array has one item). If I click on the column header, the item appears.
>>
>> How can I get it to automatically appear the first time?
>
> You're not giving enough information for anyone to do more than guess, but
> my guess is that the problem is "alloc'ed and loaded with data". You must do
> this in an observable way (e.g. setValue:forKey:) or the NSArrayController
> won't realize that anything has happened. m.
Perhaps a technical point but to qualify this response, if the content array
is empty at the time that the controller first asks for content (i.e. before
it is populated), then a Key-Value-Observing compliant method for changing
the array must be used or the controller won't know of any changes.
The most common approach, and perhaps the easiest in this case, (assuming
that pluginInstances is the array instance variable) would be the accessor
method -setPluginInstances:(NSArray *)array that would have been defined for
this purpose.
If you are not sure why the above would work, you should familiarize
yourself with the Key Value Coding and Key Value Observing protocols:
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/ind
ex.html
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/
index.html
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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