Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kristiaand

macrumors member
Original poster
Dec 5, 2007
63
0
Hi all need some advice with a command line problem i seem to be having...

the code i have is as follows

Code:
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];
	wget=nil;

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?
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.