• 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
Weird NSInvocationOperation init behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird NSInvocationOperation init behavior


  • Subject: Weird NSInvocationOperation init behavior
  • From: Markus Spoettl <email@hidden>
  • Date: Sat, 31 May 2008 01:06:01 -0700

Hello List,

I just came across a strange thing with initializing an NSInvocationOperation object that I wanted to share and see if this is a bug in either the docs or the framework:

I had this

    NSInvocationOperation *theOp = [[NSInvocationOperation alloc]
                                       initWithTarget:self
                                             selector:@selector(func1:)
                                               object:nil];

func1 is a parameter-less method of self. The docs state that selector: can either have 0 or 1 parameters, in case of 0 object has to be nil. That's the case. However, the initialization always failed and theOp was nil when after the call. I had a feeling something wasn't right and tried this:

    NSInvocationOperation *theOp = [[NSInvocationOperation alloc]
                                       initWithTarget:self
                                             selector:@selector(func2:)
                                               object:anObject];

func2 had 1 parameter (type id). Voila, it worked.

The question is, was this my fault?

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Weird NSInvocationOperation init behavior
      • From: Michael Vannorsdel <email@hidden>
  • Prev by Date: Re: super respondsToSelector
  • Next by Date: Re: super respondsToSelector
  • Previous by thread: Re: Problem in continuing display time
  • Next by thread: Re: Weird NSInvocationOperation init behavior
  • Index(es):
    • Date
    • Thread