• 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: A question about IMP
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question about IMP


  • Subject: Re: A question about IMP
  • From: Dietrich Epp <email@hidden>
  • Date: Sun, 16 Feb 2003 00:15:42 -0800

On Friday, Feb 14, 2003, at 12:56 US/Pacific, Roman Fischer wrote:

I know I can use the IMP to call directly a methods code, eg:

SEL s = @selector(myMethod);
IMP i = [myObject methodForSelector:s];
i(anObject,anSelector);

I understand that the function call needs an object it reference to (eg. for
a link to the instance variables of an object).

But why does the function call need a selector? I would think that the IMP
IS the reference without the need of a Selector again. Even if I put nil
into the place of "anSelector" it seems to me to work without any problems.

Can anybody explain the reason for that parameter to me?

I just accepted it and moved on =)

Sometimes the IMP doesn't know what selector it is for. By the way, you might want to cast your IMP in the future.
_______________________________________________
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.
References: 
 >A question about IMP (From: Roman Fischer <email@hidden>)

  • Prev by Date: Re: IB is confused (or I am :-)
  • Next by Date: Re: Protecting singleton objects from releasing
  • Previous by thread: Re: A question about IMP
  • Next by thread: pasting into other apps - is it possible?
  • Index(es):
    • Date
    • Thread