Note that there are some explanatory texts on larger screens.

plurals
  1. POJailbroken iOS: NSTaskDidTerminateNotification fails to launch selector
    primarykey
    data
    text
    <p>I seem to have the same problem as here: <a href="https://stackoverflow.com/questions/5139092/nstask-waituntilexit-hanging-app-on-jailbroken-ios">NSTask waitUntilExit hanging app on jailbroken iOS</a></p> <p>Here's what I've got via NSNotification (like above), yet the <code>taskEnded:</code> alert(s) aren't coming up. The script is definitely run, as I can see it in the debugger.</p> <pre><code>-(IBAction) supported { stask = [[NSTask alloc] init]; [stask setLaunchPath:@"/bin/bash"]; NSString *script; script = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/apps.sh"]; NSArray *sargs = [NSArray arrayWithObjects:script, @"-txt", nil]; [stask setArguments: sargs]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(taskEnded:) name: NSTaskDidTerminateNotification object: nil]; [stask launch]; } - (void)taskEnded:(NSNotification *)notification { if (stask == [[notification object] terminationStatus]) { NSString *apps; apps = [NSString stringWithContentsOfFile:@"/var/mobile/supported.txt" encoding:NSUTF8StringEncoding error:nil]; NSFileManager *fm = [NSFileManager defaultManager]; if ([fm fileExistsAtPath:apps]) { UIAlertView *supported = [[UIAlertView alloc] initWithTitle:@"Apps" message:apps delegate:self cancelButtonTitle:@"Ok!" otherButtonTitles:nil]; [supported show]; [supported release]; } else { UIAlertView *supported = [[UIAlertView alloc] initWithTitle:@"Apps" message:@"Error generating list." delegate:self cancelButtonTitle:@"Ok!" otherButtonTitles:nil]; [supported show]; [supported release]; } } else { NSLog(@"Task failed."); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload