Weird NSInvocationOperation init behavior
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