• 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: Question on NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on NSScrollView


  • Subject: Re: Question on NSScrollView
  • From: Varun Chandramohan <email@hidden>
  • Date: Fri, 02 May 2014 00:25:54 +0000
  • Thread-topic: Question on NSScrollView

Hi Quincey,

Yes I have implemented tableView:isGroupRow.

- (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row {

    DesktopEntity *entity = _tableContents[row];

    if ([entity isKindOfClass:[DesktopFolderEntity class]]) {

        return YES;

    }

    return NO;

}

What is wrong with this?

Also I implemented

- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {

    DesktopEntity *entity = _tableContents[row];

    if ([entity isKindOfClass:[DesktopFolderEntity class]]) {

        NSTableCellView *groupCell = [tableView makeViewWithIdentifier:@"GroupCell" owner:self];

        [groupCell.textField setStringValue:entity.name];

        return groupCell;

    }

    return nil;

}

Are you saying I should not return nil here?

Regards,
Varun

From: Quincey Morris <email@hidden<mailto:email@hidden>>
Date: Friday, 2 May 2014 9:10 am
To: Development <email@hidden<mailto:email@hidden>>
Cc: Cocoa dev <email@hidden<mailto:email@hidden>>
Subject: Re: Question on NSScrollView

On May 1, 2014, at 15:16 , Varun Chandramohan <email@hidden<mailto:email@hidden>> wrote:

However this is not the case with the same table
populated manually using NSPasteboardReading and NSTableViewDataSource,
NSTableViewDelegate. I noticed a grey background to all the entries to the
table.

It looks like you have inadvertently turned all the rows into group rows. There are a couple of ways this might happen, that I can think of offhand. One is (obviously) if you implemented the 'tableView:isGroupRow:' delegate method and returned YES. Otherwise, make sure in methods like 'tableView:objectValue...' and 'tableView:willDisplayCell...' or 'tableView:viewForTableColumn...' that you don't return a non-nil value when the column is nil. (A nil column is how the table view asks the delegate/data source for per-row values that span columns.)

_______________________________________________

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: Question on NSScrollView
      • From: Quincey Morris <email@hidden>
References: 
 >Re: Question on NSScrollView (From: Varun Chandramohan <email@hidden>)
 >Re: Question on NSScrollView (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Question on NSScrollView
  • Next by Date: Re: Question on NSScrollView
  • Previous by thread: Re: Question on NSScrollView
  • Next by thread: Re: Question on NSScrollView
  • Index(es):
    • Date
    • Thread