• 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: How to avoid warning with objc_msgSend
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid warning with objc_msgSend


  • Subject: Re: How to avoid warning with objc_msgSend
  • From: Glenn Andreas <email@hidden>
  • Date: Tue, 5 Oct 2004 09:01:26 -0500

At 1:46 AM -0700 10/5/04, Ryan Norton wrote:
Hi John,

It's pretty unusual to call objc_msgSend() yourself. What are you trying to do?

Trying to call something that may not exist on the system :).

For example, in our case, getRectsBeingDrawn only exists on 10.3 - but we want our app to be able to work on 10.1 and up without any warnings (runtime or otherwise) -


Another thing to do is to make a small framework with the missing functionality, which is loaded dynamically at startup.

For example, in your case, you make a small category for NSView that implements getRectsBeingDrawn:count: with whatever functionality you'd do in the case where it wasn't implemented (in this case, perhaps just return the entire drawing rect), and eventually bundle all that up into a framework. Since you'd include that frameworks headers, the compiler is happy, and since that bundle is only loaded on older systems you still get the newer implementation on newer systems. Plus you get to keep your code clean of "if this understands something in that OS version".

It is definitely unusual to need to call objc_msgSend().


--
Glenn Andreas email@hidden <http://www.gandreas.com/> oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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
References: 
 >Re: How to avoid warning with objc_msgSend (From: Ryan Norton <email@hidden>)

  • Prev by Date: Re: Binding/KVC : valid accessor for framework objects. (was: implicit and explicit invocation of description method)
  • Next by Date: Re: Undo group action name lost in drag operation
  • Previous by thread: Re: How to avoid warning with objc_msgSend
  • Next by thread: Re: How to avoid warning with objc_msgSend
  • Index(es):
    • Date
    • Thread