Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird NSInvocationOperation init behavior



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.