Re: Weird NSInvocationOperation init behavior

2008-05-31 Thread Markus Spoettl

On May 31, 2008, at 1:19 AM, Michael Vannorsdel wrote:

If you method is something like:

- (void)func1

then you should use @selector(func1) without the colon.



Indeed. Thank you.

Regards
Markus
--
__
Markus Spoettl



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: Weird NSInvocationOperation init behavior

2008-05-31 Thread Michael Vannorsdel

If you method is something like:

- (void)func1

then you should use @selector(func1) without the colon.


On May 31, 2008, at 2:06 AM, Markus Spoettl wrote:


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


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Weird NSInvocationOperation init behavior

2008-05-31 Thread Markus Spoettl

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



smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]