• 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: Yet another NSOutlineView question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yet another NSOutlineView question...


  • Subject: Re: Yet another NSOutlineView question...
  • From: Itrat Khan <email@hidden>
  • Date: Sat, 16 Mar 2002 01:59:09 -0500
  • Resent-date: Sat, 16 Mar 2002 02:00:57 -0500
  • Resent-from: Itrat Khan <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: email@hidden

On Saturday, March 16, 2002, at 12:56 AM, Julian Barkway wrote:

But this is exactly my problem. As I understand it, itemAtRow: merely returns the way item is portrayed in the view (in this case, as an instance of NSString) not the object itself.

Actually, itemAtRow: returns whatever you supplied in child:ofItem:, which is typically a model object. Take a look at the OutlineView example in /Developer/Examples/AppKit/OutlineView. Although the example doesn't handle selections, try modifying the code to invoke itemAtRow: after the table has loaded. You should get the model object back (a FileSystemItem object) and not a string.


The problem still remains: how do I relate the selectedRow to a data item in any one of a number of arrays? Obviously, one answer would be to somehow enumerate the view's internal structure and figure it out that way but there aren't any methods for doing this that I can see. Or I could traverse my own hierarchy and ask if an item is currently expanded or not and then search each array as required....

This is more complicated than it needs to be. Since itemAtRow: returns your model object, there's no need to find it in the model. Hopefully the above explanation clears that up.

Regards,
Itrat.

..................................................................
Itrat Khan
Modeless Software, Inc.
http://www.modeless.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: dd: speed up mouse with Cocoa?
  • Next by Date: Re: NSDictionary Palette available -- addendum
  • Previous by thread: Re: Yet another NSOutlineView question...
  • Next by thread: Terminating app when a document window has a sheet attached
  • Index(es):
    • Date
    • Thread