0

i use NSTask, works 100% but after running it (when running it, i also use an MBProcessHUD) i want to do an IBAlert with somethings in it...

here is my code

-(void) runScript {
    task = [[NSTask alloc] init];
    [task setLaunchPath:@"/bin/bash"];
    NSString *script;
    script = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"a2cy.sh"];
    NSArray *arguments = [NSArray arrayWithObjects:script, [sourcerepo text], nil];
    [task setArguments: arguments];
    [task launch];
    sleep(1);
    HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"checkmark.png"]] autorelease];
    HUD.mode = MBProgressHUDModeCustomView;
    HUD.labelText = @"Complete!";
    NSString *loggy;
    loggy = [NSString stringWithContentsOfFile:[[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/log.txt"]];
    UIAlertView *log = [[UIAlertView alloc] initWithTitle:@"Result" message:loggy delegate:self cancelButtonTitle:@"Ok!" otherButtonTitles:nil];
    [loggy show];
    [loggy release];    
}

but after running, it doesn't show up :/ any help? thanks

Ben
  • 20,737
  • 12
  • 71
  • 115
Cykey
  • 81
  • 1
  • 3

2 Answers2

1

I didn't take too close a look at it, but you're sending show to the NSString loggy rather than the UIAlert log.

outis
  • 75,655
  • 22
  • 151
  • 221
1

You need to call the alert's show method on log, not loggy..

[log show];

Ben
  • 20,737
  • 12
  • 71
  • 115