• 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
Using NSInvocation for a class method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSInvocation for a class method?


  • Subject: Using NSInvocation for a class method?
  • From: Graham Cox <email@hidden>
  • Date: Fri, 18 Jul 2008 15:46:55 +1000

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Using NSInvocation for a class method?
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: Documentation on changing dock icon programmatically?
  • Next by Date: Adding members to group in Address book
  • Previous by thread: Re: NOT or NONE in NSPredicate
  • Next by thread: Re: Using NSInvocation for a class method?
  • Index(es):
    • Date
    • Thread