• 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: BOOL parameter passed as nil object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BOOL parameter passed as nil object


  • Subject: Re: BOOL parameter passed as nil object
  • From: Sean McBride <email@hidden>
  • Date: Mon, 18 Apr 2016 22:25:05 -0400
  • Organization: Rogue Research Inc.

On Mon, 18 Apr 2016 18:56:43 -0700, Carl Hoefs said:

>Suppose I have an object with a declared method signature:
>  -(void)myMethod:(BOOL)a_bool;
>
>Q1: If I invoke it like this:
>  [self performSelector:@selector(myMethod:) withObject:nil];  // nil obj

Stop right there, you are violating the documentation of the API:

"aSelector should identify a method that takes a single argument of type id. For methods with other argument types and return values, use NSInvocation."

Is there still no compiler warning for this? :(

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >BOOL parameter passed as nil object (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: BOOL parameter passed as nil object
  • Next by Date: Re: Using protocol extension to dismiss keyboard on outside tap
  • Previous by thread: Re: BOOL parameter passed as nil object
  • Next by thread: Re: BOOL parameter passed as nil object
  • Index(es):
    • Date
    • Thread