• 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
NSInvocation driving me nuts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSInvocation driving me nuts


  • Subject: NSInvocation driving me nuts
  • From: Pierre Bernard <email@hidden>
  • Date: Sat, 8 Apr 2006 13:24:50 +0200

Can you spot the difference between:

		[delegate _managedObjectContextEditor:self
									didCommit:YES
								  contextInfo:contextInfo];

and this:

SEL selector = @selector (_managedObjectContextEditor:didCommit:contextInfo:);
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[delegate methodSignatureForSelector:selector]];
BOOL success = YES;

[invocation setTarget:delegate]; // 0
[invocation setSelector:selector]; // 1
[invocation setArgument:&self atIndex:2];
[invocation setArgument:&success atIndex:3];
[invocation setArgument:&contextInfo atIndex:4];
[invocation retainArguments];
[invocation invoke];

[invocation release];


Well, the first one works. The second does not!

TIA for your help
Pierre

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSInvocation driving me nuts
      • From: Ondra Cada <email@hidden>
    • Re: NSInvocation driving me nuts
      • From: "Pontus Ilbring" <email@hidden>
  • Prev by Date: Altering CoreData generated view/controls
  • Next by Date: Re: Unable to link universal binary
  • Previous by thread: Re: Altering CoreData generated view/controls
  • Next by thread: Re: NSInvocation driving me nuts
  • Index(es):
    • Date
    • Thread