I tried using system() to run a shell command in a .m file, but to no avail. How is it possible to run a shell command from a .m file in Xcode?
#import "AppController.h"
@implementation AppController
- (void)awakeFromNib
{
[output setStringValue:@"Awaiting orders, sir."];
}
- (IBAction)convertFile:(id)sender
{
NSString *string = [input stringValue];
NSString *string2 = @"tar czvf ProjectFiles.tar.gz ";
NSString *stringCmd = [NSString stringWithFormat:@"%@ %@", string2, string];
system(stringCmd);
}
@end