Xcode projet with auxiliary binaries
The test project of the myAlert tool can serve as a demo of how to configure an Xcode Project containing an auxiliary binary and even embedded binaries as for FullProf4Mac, Esmeralda, PkFit4Mac, etc.
Goals of the myAlert tool
The goal of the "myAlert" tool is to offer Alert dialogues to applications having no GUI such as C or Fortran command line applications, shell scripts, etc.
myAlert is an Objective C command line tool which accepts the following arguments:
-v verbose if placed in 1rst position
-t a title string
-m a message string
-i alert type: 0=Warning 1=Critical 2=Informational
-d delay in seconds of alert autoclosing (0=permanent)
-n name of an icon file to be placed in the bundle folder Contents/Resources
Command line call:
$./myAlert -t "A title" -m 'An important message!' -i 1 -d 20 -n "../Resources/myIcon.png
C Language call:
strcpy(command, "'");
strcat(command, AlertFilePath);
strcat(command, "'"); // do not move it to the end of the command!
//======= the alert's parameters ==================
strcat(command, " -t 'My Alert' -m 'My Message' -n 'icon.png'");
//=======================================
i=system(command);
Xcode project
The myAlert binary must be added to the Contents/MacOS folder of the bundle of the application that needs alerts.
The optional icon file must be in Contents/Resources
TestAlert.app
Contents
MacOS
TestAlert <-- binary calling myAlert
myAlert <-- command line tool
Resources
icon.png
We explain below how to implement myAlert in an Xcode project. so that the application can be codesigned and sandboxed.
The following is an update to Xcode 10 of this recipe:
<http://www.smallersystems.com/blog/2008/05/embedding-a-command-line-tool-within-a-cocoa-application/>