Skip to content

Instantly share code, notes, and snippets.

@jontelang
Created March 21, 2013 15:19
Show Gist options
  • Save jontelang/5213847 to your computer and use it in GitHub Desktop.
Save jontelang/5213847 to your computer and use it in GitHub Desktop.
kill pid
if( [a isRunning] )
{
int pid = [a pid];
NSLog(@"pid: %i", pid);
NSString *cmd = [NSString stringWithFormat:@"kill %i",pid];
NSLog(@"%@",cmd);
const char *command = [cmd UTF8String];
NSLog(@"%s",command);
int result = system(command);
NSLog(@"%i",result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment