I would like to pass NSTask (NSTask, launchpath, and the args) to a function, but sure I need some help with the semantic:
AppleDelegate.h file:
- (void)doTask:(NSTask*)theTask :(NSArray*)arguments :(NSString*)launchPath;
AppleDelegate.m file:
- (void)doTask:(NSTask*)theTask :(NSArray*)arguments :(NSString*)launchPath
{
self.currentTask = theTask;
// do currentTask alloc, set the launcpath and the args, pipe and more
}
Here is the code to call "doTask":
NSTask* runMyTask;
NSString *command = @"/usr/bin/hdiutil";
NSArray* taskArgs = [NSArray arrayWithObjects:@"info", @"/", nil];
// Here the error:
[self doTask:runMyTask, taskArgs, command]; // ARC Semantic issue no visible interface for AppleDelegate declares the selector 'doTask'..
The selector appears as undeclared, but I thought I did declare it... Is it possible to do something like this, where is the mistake?