I’m using the library STPrivilegedTask library, source found at http://www.sveinbjorn.org/STPrivilegedTask to run the NSTask with sudo permissions.
This is the code I’m using to instantiate an STPrivilegedTask object but I’m getting syntax error:
STPrivilegedTask *task2 = [[STPrivilegedTask alloc] initWithLaunchPath: launchPath: arguments];
I’m getting “Receiver type STPrivilegedTask for instance method does not declare a method…” error. Is the above syntax valid?
Thanks,
Not an expert in objective-C, but if I’m not wrong, you should call it like that:
(Assuming
argumentsin your method is your NSArray) Since the declaration of the method is:And not
This is an example from the
.mfile in the link you added: