• 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
NSOperation: Selector being called before process finished
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSOperation: Selector being called before process finished
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Making failed NSAsserts crash an app
  • Next by Date: Leaks in NSDateComponenets object.
  • Previous by thread: Re: How to Convert "#FF00FF" String Specifying RGB Color to 32 bit int
  • Next by thread: Re: NSOperation: Selector being called before process finished
  • Index(es):
    • Date
    • Thread