• 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
Progressbar Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Progressbar Question


  • Subject: Progressbar Question
  • From: Tom Jones <email@hidden>
  • Date: Sat, 17 Feb 2007 13:23:57 -0800
  • Thread-topic: Progressbar Question

Hello,
I've been teaching myself ObjC so that I could learn Cocoa, which really
helped. So I'm moving on from Foundation Tools to an actual GUI.

So my first app is to use NSTask to run a Command line app and parse it's
output. I've got it to run and I thought I did well until I tried to start
with the progressbar. It wont start until my CLI app as finished.

So what am I doing wrong,
Thanks,
Tom

PS: Here is my snippet of code for my push button


- (IBAction)CheckIt:(id)sender
{

    [progressbar startAnimation:self];

    NSData *results;
    NSString *data;

    NSTask *cliCMD = [[NSTask alloc] init];
    NSPipe *pipe = [NSPipe pipe];
    NSFileHandle *fh = [pipe fileHandleForReading];

    // Set Bin Path
    [cliCMD setLaunchPath:@"/usr/local/bin/myFoundTool"];
    // Set Args
    [cliCMD setArguments:[NSArray arrayWithObjects:@"--list",nil]];

    // Set where the results should go
    [cliCMD setStandardOutput:pipe];
    // Run the Command
    [cliCMD launch];

    results = [fh readDataToEndOfFile];
    data = [[NSString alloc] initWithData: results encoding:
NSUTF8StringEncoding];
    [myTextField setStringValue: data];


    //[progressbar stopAnimation:self];

}


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Progressbar Question
      • From: Michael Babin <email@hidden>
  • Prev by Date: Re: Newbie interface question
  • Next by Date: Re: Newbie interface question
  • Previous by thread: Re: Newbie interface question
  • Next by thread: Re: Progressbar Question
  • Index(es):
    • Date
    • Thread