• 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
Managing selectedObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Managing selectedObjects


  • Subject: Managing selectedObjects
  • From: goessly <email@hidden>
  • Date: Mon, 9 Jan 2006 13:10:33 +0100

I am successfully performing some actions on an array of objects from an NSTreeController, like this:

[myTextField setStringValue:
	[[[myTreeController selectedObjects] objectAtIndex: myCounter]
	valueForKeyPath:@"myKey"]];

It is important to allow for multiple selections- and keep them. So I chose to use "selectedObjects" and iterate over the array.
Writing this string value to the interface is "one-way", no problem.
_Getting_ input from the interface - i.e. via a checkbox, representing a boolean member variable of the current object - would usually require binding the checkbox to arrangedObjects.selection.someBooleanMember


So how can I provide the interface with access to
[[myTreeController selectedObjects] objectAtIndex: myCounter]
so that I can use it instead of "selection" in the keypath?
I guess it's not to much trouble to just code the getters and setters, but bindings are a bit quicker ^^


So any suggestions?
Best Regards,
goessly
_______________________________________________
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


  • Prev by Date: Re: dumb NSLog question
  • Next by Date: Problems using (verifying) mock objects more than once
  • Previous by thread: How to write predicate to filter for to-many relationship
  • Next by thread: Problems using (verifying) mock objects more than once
  • Index(es):
    • Date
    • Thread