• 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: NSOutlineView selectedRow error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView selectedRow error?


  • Subject: Re: NSOutlineView selectedRow error?
  • From: Corbin Dunn <email@hidden>
  • Date: Tue, 7 Mar 2006 21:23:53 -0800


When I click the button I placed to draw the template image into my custom panel, here is the code I use to retrieve the image:


int selectedRow = [templateView selectedRow];

NSImage *ti = [[[templateView tableColumnWithIdentifier:@"Image"]
							dataCellForRow:selectedRow] objectValue];
NSLog(@"I think the currently selected row is: %x", selectedRow);
NSLog(@"Image test from Template: %@", ti);

This code is incorrect; you need a little more code, like (typed in mail):


NSTableColumn *column = [templateView tableColumnWithIdentifier:@"Image"];
NSCell *cell = [column dataCellForRow:selectedRow];
[cell setObjectValue:[[templateView datasource] outlineView:templateView objectValueForTableColumn:column
byItem:[templateView itemAtRow:selectedRow]]];


The reason for this is because the same cell is used to "stamp" out each row.

--corbin
_______________________________________________
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


  • Follow-Ups:
    • Re: NSOutlineView selectedRow error?
      • From: Corbin Dunn <email@hidden>
References: 
 >Re: NSOutlineView selectedRow error? (From: Greg Herlihy <email@hidden>)
 >Re: NSOutlineView selectedRow error? (From: Scott Harper <email@hidden>)

  • Prev by Date: Re: NSOutlineView selectedRow error?
  • Next by Date: Re: NSOutlineView selectedRow error?
  • Previous by thread: Re: NSOutlineView selectedRow error?
  • Next by thread: Re: NSOutlineView selectedRow error?
  • Index(es):
    • Date
    • Thread