Closed mick-ntrepid closed 8 years ago
You only need to call [invocation invoke]
. Changing its selector will break it.
Thanks for the response - sorry, still confused.
How do I set the invocation to call a specific method? In my example, I'm trying to call 'myTestMethod'. I need to execute some code after the update is completed and before relaunch.
You must not set up a call. It's already set up for you. You only invoke it after you've done whatever else you needed to do. You call methods in your own program as usual.
Still not getting it ... What gets called? Confused about the 'untilInvoking' piece of the method. I assume I have to tell it what I want it to do? Is there anything I need to set up inside the method? Right now I just call [invocation invoke] and return YES, Works, but doesn't do anything.
thanks.
OK, think I understand it ...
In the shouldPostpone method, I include any processing I want done - THEN I call invocation invoke and finally return YES.
Yes.
(or you can store the invocation elsewhere, return yes, then call invoke anytime later. It behaves like callback in nodejs).
Right - eventually I'm going to need an NSWindow, so I can store the invocation and call it from a button in the Window. Thx for the help.
The docs for the 'postponeRelaunch' method are somewhat confusing (at least to me):
// Return YES to delay the relaunch until you do some processing. // Invoke the provided NSInvocation to continue the relaunch.
This is some simple example code which doesn't work as expected:
-(BOOL)updater:(SUUpdater )updater shouldPostponeRelaunchForUpdate:(SUAppcastItem )update untilInvoking:(NSInvocation *)invocation {
}
I'm not sure how the shouldPostpone delegate should be implemented - some simple sample code would be greatly appreciated.
-Mick mick.oyer@ntrepidcorp.com