• 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
Re: Checking a method for parameter types via SEL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking a method for parameter types via SEL


  • Subject: Re: Checking a method for parameter types via SEL
  • From: Erik Buck <email@hidden>
  • Date: Mon, 31 Jul 2006 14:19:07 -0700 (PDT)

What you are doing looks bizarre to me.

  How about

  @implementation NSCoder (ConditionalCoding)

-(void)encodeObject:(id)obj onCondition:(SEL)cond withOwner:(id)owner
{
     SEL       encodeSelector = @selector(encodeObject:);

     if([obj respondsToSelector:cond])
     {
        if(![obj performSelector:cond withObject:owner])
        {
           encodeSelector = @selector(encodeConditionalObject:);
        }
     }

     [self performSelector:encodeSelector withObject:obj];
}

@end

 _______________________________________________
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: iconForFile
  • Next by Date: Re: Re: NSTabView and edit fields
  • Previous by thread: Re: Re: Checking a method for parameter types via SEL
  • Next by thread: Obtaining environment variables from a cross-referenced project
  • Index(es):
    • Date
    • Thread