• 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: Sending messages to nil -- anyway to detect this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending messages to nil -- anyway to detect this?


  • Subject: Re: Sending messages to nil -- anyway to detect this?
  • From: Ali Ozer <email@hidden>
  • Date: Mon, 25 Jun 2001 18:29:08 -0700

The runtime has a mechanism for detecting this. You can register a
callback to detect messages being sent to nil.
void objc_setNilObjectMsgHandler(NilObjectMsgCallback
nilObjMsgCallback)
where the prototype for the call back is
typedef void (*NilObjectMsgCallback) (id nilObject, SEL selector)

See objc/objc-runtime.m (part of Darwin) for details. For gory details
look for the label LMsgSendNilSelf: in objc-msg-ppc.s.

Please note that these functions are NOT public API in Mac OS X, and thus can go away or get renamed at any point. Production code which is supposed to run across several versions of the system should not use or depend on these functions. However, for your testing or other purposes, it's fine to use these.

Ali


References: 
 >Re: Sending messages to nil -- anyway to detect this? (From: Chuck Fleming <email@hidden>)

  • Prev by Date: Re: Plugin Interface
  • Next by Date: field editor oddness
  • Previous by thread: Re: Sending messages to nil -- anyway to detect this?
  • Next by thread: email auto-reply program
  • Index(es):
    • Date
    • Thread