• 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
Bindings and Editing in a row
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings and Editing in a row


  • Subject: Bindings and Editing in a row
  • From: John MacMullin <email@hidden>
  • Date: Tue, 17 Feb 2015 13:35:12 -0700

Ok with programmatic bindings, I have:

1.	<NSTableViewDelegate, NSTableViewDataSource> on the interface.

2.	In set up:
NSButtonCell *recCell11 = [NSButtonCell new];
[recCell11 setButtonType:NSSwitchButton];
[recCell11 setTitle:NULL_STRING];
[recCell11 setImagePosition:NSImageOnly];
[recCell11 setEditable:YES];
[[transTableView tableColumnWithIdentifier:@"11"]setDataCell:recCell11];
 [[transTableView tableColumnWithIdentifier:@"11"]setEditable:YES];

Plus my bindings in all columns.

3.	Also, in set up:

        [transTableView setDelegate:self];
        [transTableView setDataSource:self];

4.	Later in the code:

- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row
{
    if (tableView) {
        if (row >=0) {
            return YES;
        }
    }
    return YES;
}

5. Commented Out in the code:

/*

- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
    NSLog(@"shouldEditTableColumn");
    if ([tableView tag] == 10 ) {
		if (([tableColumn identifier] == @"11") && (row >= 0)) {
			return YES;
		} else {
			return NO;
		}
    }
    return NO;
}
*/

and 6. My:

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

which works just fine.


So it appears that I don’t need shouldEditTableColumn because of the bindings.  Where is this in the docs? (rather than random cocoa sources).

If I take out the following:

- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row
{
    if (tableView) {
        if (row >=0) {
            return YES;
        }
    }
    return YES;
}

I can’t select any row.  So it would appear that some of the table view methods operate independently of the bindings.  Where is this documented?


Best regards,

John MacMullin
_______________________________________________

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: Bindings and Editing in a row
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Package/folder confusion
  • Next by Date: Re: Package/folder confusion
  • Previous by thread: Re: Package/folder confusion
  • Next by thread: Re: Bindings and Editing in a row
  • Index(es):
    • Date
    • Thread