• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Set up an editable view based NSTableView programmatically - how to?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set up an editable view based NSTableView programmatically - how to?


  • Subject: Re: Set up an editable view based NSTableView programmatically - how to?
  • From: Peter <email@hidden>
  • Date: Tue, 07 Jan 2014 21:38:26 +0100

Thank you for your comment.

Did you really manage to create *editable* view-based table views with data sources?
Then I am curious to know how you managed to make them editable.
A data source method channeling data from the table view to the data source is nowhere to be seen.

- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row

does not seem to be called.

I have a view based table view working with a data source. But it is not (yet) editable.

The only thing I can imagine is to catch textDidEndEditing in a delegate from the field editor and get the value via editedRow and editedColumn or something similar.
But this is rather awkward.

I wonder why there is nothing relevant in the docs, no example on the web...

Am 07.01.2014 um 18:11 schrieb Keary Suska <email@hidden>:

>
> On Jan 7, 2014, at 9:40 AM, Peter wrote:
>
>>
>> Am 07.01.2014 um 17:32 schrieb Jens Alfke <email@hidden>:
>>
>>>
>>> On Jan 7, 2014, at 7:52 AM, Peter <email@hidden> wrote:
>>>
>>>> I’d be very happy if somebody could point me to an example of an editable NSTableView set up programmatically.
>>>
>>> It sounds like you just mean using a custom data source rather than relying on bindings to provide the data? That’s very easy to do. Just look at the docs for NSTableViewDataSource — you just need to implement the three methods to provide the row count, get a cell value, and set a cell value.
>>>
>>> —Jens
>>
>> Oops, sorry, the crucial info is only in the subject line: I meant a view based NSTableView. Which as far as I could find out does not make use of the NSTableViewDataSource protocol. I seems that you have to have to use delegate methods to make it work.
>
> Umm, in the documentation for NSTableCellView it sats:
>
> objectValue
>
> The object that represents the cell data.
>
> @property(retain) id objectValue
> Discussion
>
> The objectValue is automatically set by the table when using bindings or is the object returned by the NSTableViewDataSource protocol method tableView:objectValueForTableColumn:row:.
>
> Not to mention that I have used view-based table views with data sources...
>
> Keary Suska
> Esoteritech, Inc.
> "Demystifying technology for your home or business"
>
>


_______________________________________________

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


  • Follow-Ups:
    • Re: Set up an editable view based NSTableView programmatically - how to?
      • From: Keary Suska <email@hidden>
References: 
 >Set up an editable view based NSTableView programmatically - how to? (From: Peter <email@hidden>)
 >Re: Set up an editable view based NSTableView programmatically - how to? (From: Jens Alfke <email@hidden>)
 >Re: Set up an editable view based NSTableView programmatically - how to? (From: Peter <email@hidden>)
 >Re: Set up an editable view based NSTableView programmatically - how to? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: BT data (NSData *) question
  • Next by Date: Re: Set up an editable view based NSTableView programmatically - how to?
  • Previous by thread: Re: Set up an editable view based NSTableView programmatically - how to?
  • Next by thread: Re: Set up an editable view based NSTableView programmatically - how to?
  • Index(es):
    • Date
    • Thread