Re: How to avoid warning with objc_msgSend
Re: How to avoid warning with objc_msgSend
- Subject: Re: How to avoid warning with objc_msgSend
- From: m <email@hidden>
- Date: Tue, 5 Oct 2004 02:34:55 -0700
On Oct 5, 2004, at 1:46 AM, Ryan Norton wrote:
One way I've figured out how to do it -
//getRectsBeingDrawn:count: is a optimization that is only
available on
//Panther (10.3) and higher. Check to see if it supports it -
if ( [GetNSView()
respondsToSelector:@selector(getRectsBeingDrawn:count:)] )
objc_msgSend(GetNSView(),@selector(getRectsBeingDrawn:
count:),&rects,&countRects);
In this case though it's a runtime check from a function that gets
called quite a bit...
I'm skeptical that checking whether a selector is implemented could be
a significant part of your total execution time. In any case, you
really only need to check whether getRectsBeingDrawn:count: is
implemented once, not every time you want to call it.
_murat
_______________________________________________
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