Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSInvocation for a class method?



Can I use NSInvocation for a class method? I can't really see what to use for setTarget: as there isn't an actual object.

Or there might be a better way to do what I want to do...

I'm trying to set up a simple scheme that maps file types to a method that can interpret and decode that file type. The idea is to avoid subclassing my document class to extend the file types it can open - instead just supply a method in a category then register it against the file type. When the document is asked to open the given type of file, it looks up the category method it has registered against that type, and invokes it.

For importing a file, the method in question would generally be a class method (file data in -> instance of data model class out) so my idea of using an NSInvocation might not be workable there. I need to wrap the invocation (selector/class/target) in some sort of object so I can put it into a dictionary, and since NSInvocation already is such an object it seemed like the obvious choice.

tia,

cheers, Graham
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


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.