• 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
New controller class sample code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

New controller class sample code


  • Subject: New controller class sample code
  • From: Shaun Wexler <email@hidden>
  • Date: Mon, 25 Aug 2003 12:06:27 -0700

I've been experimenting with the new controller classes, to determine their feasibility for my next app version. It looks like it will work well for things that aren't performance critical, but even in my first attempt at using them, I've hit some limitations, probably just overlooking the obvious. Due to NDA, [we] can't discuss the particulars of the unreleased code/classes, though most of them have been announced publicly now, but I'd like to ask, without mentioning specifics, if anyone else has also had good results so far, and/or done any extensive testing, and would like to share sample code with me?

I have one app that runs a NSTableView, several bound controls, saves a document, populates NSPopUpButton and NSComboBox controls, and has a disclosable window which reveals a hidden NSBox. The actual code in my NSDocument subclass is very minimal to achieve this functionality, but before filing bugs to request more features/enhancements, I'd like to find out if there are other ways to achieve what I want with the current implementations (bindings, etc). Emails off-list are fine, and I may be able to provide the URL to download my little sample app, since it requires the NDA'd OS to launch it anyway... suggestions? What I want to achieve is an NSet of the string values from this example plist...

<array>
<dict>
<key>key</key>
<string>objectA</string>
</dict>
<dict>
<key>key</key>
<string>objectB</string>
</dict>
<dict>
<key>key</key>
<string>objectA</string>
</dict>
</array>

...resulting in this array(set):

<array>
<string>objectA</string>
<string>objectB</string>
</array>

...but have the result set automatically maintained by the controller layer. My first thought was to subclass a controller (and file a Radar requesting this new class), to provide the NSSet functionality, similar to getting the array of allKeys of an NSDictionary, if the object strings were uses as its keys. This way, I can populate an NSComboBox with a set of the contents of a bound array from a datasource of the standard type the controllers manage.

Also, I'd like to know the best way to determine when the bound contentArray has a property changed. As far as I can tell, I'll have to subclass the controller objects to get the editor messages. Correct?
--
Shaun Wexler
MacFOH
http://www.macfoh.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: Java Bridge and Weird Jar File
  • Next by Date: Re: Filename of the file opened via the open menu
  • Previous by thread: Java Bridge and Weird Jar File
  • Next by thread: (NEWBIE) NSOutlineView question
  • Index(es):
    • Date
    • Thread