| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Nov 1, 2007, at 6:43 PM, Major Domo wrote:
Solution 1: Write your -books scripting KVC accessors to return the media objects filtered to where the type is "book". Sketch has an example of how to do this. Cut, paste and modify for all the other peer types to Book. Cut and paste code can be distasteful, but if you only have a few this gets you working code that you can ship while you come up with a better solution. Solution 2: Write a more generic scripting KVC container that can takes advantage of the ...inPropertyWithKey: KVC methods, as well as -valueForUndefinedKey:. In my case, my containers are immutable (in the traditional KVC sense) so I only had to worry about the latter. When the key comes in, I look at the key and see if it is one for which there is a pre-configured rule which says "books" can be derived from "media" using this filter rule, and if there is, I do it, otherwise message super. There is also caching going on to improve access time, observation to invalidate the caches. And I still haven't implemented the replace, insert, and remove methods. It is a possible generic solution to this problem. The cut and paste solution is probably uglier, but may get you to working code faster. (At the expense of that ugliness, and having to modify the container for each new type introduced.) Jim |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-implementors mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-implementors/email@hidden This email sent to email@hidden
| References: | |
| >Re: AppleScript-Cocoa Impedance Mismatch (From: Major Domo <email@hidden>) | |
| >Re: AppleScript-Cocoa Impedance Mismatch (From: Jim Correia <email@hidden>) | |
| >Re: AppleScript-Cocoa Impedance Mismatch (From: Major Domo <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.