NSOperation: Selector being called before process finished
NSOperation: Selector being called before process finished
- Subject: NSOperation: Selector being called before process finished
- From: PCWiz <email@hidden>
- Date: Wed, 26 Aug 2009 18:01:56 -0600
Hi,
I have a class which is a subclass of NSOperation, that runs a shell
script with AuthorizationExecuteWithPrivileges. Something like this:
// Alloc my auth class and authenticate
Authentication *auth = [[Authentication alloc] init];
[auth authenticate];
// Set permissions on script and run script with
AuthorizationExecuteWithPrivileges
[auth executeShellCommand:@"chmod 755 /script.sh; chown $USER:admin /
script.sh; sh /script.sh"];
// Then call selector on main thread to notify that its finished
[[AppDelegate shared] performSelectorOnMainThread:@selector(scriptDone)
withObject:nil
waitUntilDone:YES];
( "shared" is just a method in my main delegat class that returns
[[AppDelegate alloc] init]). The issue is that the selector is being
called a few seconds after the script starts, not when its finished.
Thanks
_______________________________________________
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