Revision: 7545
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7545&view=rev
Author:   hofman
Date:     2011-11-23 11:13:21 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
use convenience method to create invocation

Modified Paths:
--------------
    trunk/SKMainWindowController_UI.m
    trunk/SKNoteWindowController.m

Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m   2011-11-22 18:18:26 UTC (rev 7544)
+++ trunk/SKMainWindowController_UI.m   2011-11-23 11:13:21 UTC (rev 7545)
@@ -73,6 +73,7 @@
 #import "SKDocumentController.h"
 #import "NSError_SKExtensions.h"
 #import "PDFView_SKExtensions.h"
+#import "NSInvocation_SKExtensions.h"
 
 #define NOTES_KEY       @"notes"
 #define SNAPSHOTS_KEY   @"snapshots"
@@ -1149,10 +1150,7 @@
     BOOL didCommit = [self commitEditing];
     if (delegate && didCommitSelector) {
         // - (void)editor:(id)editor didCommit:(BOOL)didCommit 
contextInfo:(void *)contextInfo
-        NSInvocation *invocation = [NSInvocation 
invocationWithMethodSignature:[delegate 
methodSignatureForSelector:didCommitSelector]];
-        [invocation setTarget:delegate];
-        [invocation setSelector:didCommitSelector];
-        [invocation setArgument:&self atIndex:2];
+        NSInvocation *invocation = [NSInvocation invocationWithTarget:delegate 
selector:didCommitSelector argument:&self];
         [invocation setArgument:&didCommit atIndex:3];
         [invocation setArgument:&contextInfo atIndex:4];
         [invocation invoke];

Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m      2011-11-22 18:18:26 UTC (rev 7544)
+++ trunk/SKNoteWindowController.m      2011-11-23 11:13:21 UTC (rev 7545)
@@ -54,6 +54,7 @@
 #import "NSGeometry_SKExtensions.h"
 #import "NSGraphics_SKExtensions.h"
 #import "SKNoteTextView.h"
+#import "NSInvocation_SKExtensions.h"
 
 #define EM_DASH_CHARACTER 0x2014
 
@@ -315,12 +316,9 @@
 
 - (void)commitEditingWithDelegate:(id)delegate 
didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo {
     if (delegate && didCommitSelector) {
-        NSInvocation *invocation = [[NSInvocation 
invocationWithMethodSignature:[delegate 
methodSignatureForSelector:didCommitSelector]] retain];
-        [invocation setTarget:delegate];
-        [invocation setSelector:didCommitSelector];
-        [invocation setArgument:&self atIndex:2];
+        NSInvocation *invocation = [NSInvocation invocationWithTarget:delegate 
selector:didCommitSelector argument:&self];
         [invocation setArgument:&contextInfo atIndex:4];
-        return [noteController commitEditingWithDelegate:self 
didCommitSelector:@selector(editor:didCommit:contextInfo:) 
contextInfo:invocation];
+        return [noteController commitEditingWithDelegate:self 
didCommitSelector:@selector(editor:didCommit:contextInfo:) 
contextInfo:[invocation retain]];
     }
     return [noteController commitEditingWithDelegate:delegate 
didCommitSelector:didCommitSelector contextInfo:contextInfo];
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to