Im trying to make a Mac application that speaks user inputed NSTextField text using “system” to use the say command in terminal. However, Xcode keeps giving errors.
- (IBAction)speak:(id)sender{
system("say %@", [textinput stringValue]);
}
*textinput is the IBOutlet of the NSTextField.
System takes a single char* as an argument, so you have to format the command string before you can pass it to system: