• 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: NULL SEL arguments in Jaguar?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NULL SEL arguments in Jaguar?


  • Subject: Re: NULL SEL arguments in Jaguar?
  • From: Ali Ozer <email@hidden>
  • Date: Sat, 24 Aug 2002 14:42:47 -0700

The AppKit release notes for Jaguar say this, under the heading "SEL
Arguments":

"Foundation has been inconsistent in its handling of NULL SEL arguments in
the past. In 10.2, for applications linked on 10.2 or later, Foundation
raises exceptions in all functions and methods (such as NSObjects
-respondsToSelector:) that take SEL arguments if the SEL argument is NULL."

I don't understand why this note is in the AppKit release notes, if it only
applies to Foundation.

It apparently does not in fact apply to the AppKit. For example, the
NSBeginAlertSheet() function in the AppKit takes two SEL parameters,
didEndSelector and didDismissSelector, and the documentation has always said
you should pass NULL in either of these parameters that you don't use. I do
this, and I get no exceptions.

Typically NULL SELs, nil objects, etc are invalid arguments, unless explicitly indicated as an allowed exception --- which they are in the case of the sheet functions and methods. (Similarly nil target is a special indication of first responder, etc).

I am not sure off the top of my head, but I believe there are a few cases where this applies in the AppKit, such as nil actions, etc --- hence the warning in the AppKit relnotes. You're right that it would have been a good idea to include this in the Foundation release notes as well, as it does apply to NSObject methods.

Ali
_______________________________________________
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.

  • Follow-Ups:
    • Re: NULL SEL arguments in Jaguar?
      • From: Ali Ozer <email@hidden>
References: 
 >NULL SEL arguments in Jaguar? (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: where are the faster compilations?
  • Next by Date: NSTableView issues?
  • Previous by thread: NULL SEL arguments in Jaguar?
  • Next by thread: Re: NULL SEL arguments in Jaguar?
  • Index(es):
    • Date
    • Thread