• 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
Replacing a tableView Cell with null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing a tableView Cell with null


  • Subject: Replacing a tableView Cell with null
  • From: Steven Hamilton <email@hidden>
  • Date: Sat, 6 Jun 2009 09:01:02 +1000

Hi,
I have an NSTableview populated by bindings to Core Data. In one column I have a popupbutton (bad idea as its slow, I know) and in another I have a checkbox. I only want the checkbox to be available when certain items from the popupbutton are selected. To try and do this I've implemented;


- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
if ([[tableColumn identifier] isEqualToString:@"budget"]) {
//Fetch account type
Account *selectedAccount = [[accountsController arrangedObjects] objectAtIndex:row];
if ([[selectedAccount valueForKeyPath:@"type.name"] isEqualToString:@"Assets"]
|| [[selectedAccount valueForKeyPath:@"type.name"] isEqualToString:@"Liabilities"]){
[cell setEnabled:FALSE];
[selectedAccount setValue:FALSE forKey:@"envelopeVisible"];
}
}
}


This disables the checkbox which nearly works barring a slight issue with refresh. I'd much rather though just display nothing at all and only have the checkbox visible on the rows that need it. Is there a way to change the cell to just blank rather than a checkbox? Or am I going about this the wrong way and set the column to blank and programmatically create checkboxes when I need them?
_______________________________________________


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: Replacing a tableView Cell with null
      • From: Corbin Dunn <email@hidden>
  • Prev by Date: Re: Hiding Glyphs
  • Next by Date: Re: Hiding Glyphs
  • Previous by thread: Re: Profiling a drag and drop operation
  • Next by thread: Re: Replacing a tableView Cell with null
  • Index(es):
    • Date
    • Thread