command line function failing?

Discussion in 'Mac Programming' started by kristiaand, Jan 13, 2008.

  1. kristiaand macrumors member

    Dec 5, 2007
    Hi all need some advice with a command line problem i seem to be having...

    the code i have is as follows

    wget=[[NSTask alloc] init];
    	[wget launchPath:@"~/share/emacs/pkg/osx/"];
    	[wget setArguments:[NSArray arrayWithObjects:@"osascript -e 'mount volume """"smb://workgroup; : @homepc/x drive""'",nil]];
    	[wget launch];
    	[wget release];
    this compiles fine but when i run it and click my button i get the following error from the xcode console..

    2008-01-13 22:00:33.137 HelloWorld[2310] *** -[NSConcreteTask launchPath:]: selector not recognized [self = 0x37b730]

    i get the feeling this is obviously something todo with my launch path but i cannot seem to fine OSASCRIPT when i spotlight it, so i am at a bit of a loss i have also tried google but nothing seems to indicate where it is.

    any ideas anyone?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    If you read the documentation you will see that launchPath returns a NSString and takes no arguments (as noted by the lack of :). There is not launchPath: to set the launch path. So you are trying to call a method that simply does not exist. It's nothing to do with the path you are trying to set.

Share This Page