title: How do I clear the console in Objective-C
body: <p>I'm  making a console-based application in Objective-C which relies on being able to <strong>clear the console</strong> periodically. How can this be done? All I've seen on SO and Google were ways to have the developer clear the console with X-Code, but that will <em>not</em> do.</p>
  
  <p>One solution I found on Yahoo! Answers told me to do the following, but it does not run due to being unable to find a file:</p>
  
  <pre><code>NSTask *task;
  task = [[NSTask alloc]init];
  [task setLaunchPath: @"/bin/bash"];
  
  NSArray *arguments;
  arguments = [NSArray arrayWithObjects: @"clear", nil];
  [task setArguments: arguments];
  
  [task launch];
  [task waitUntilExit];
  </code></pre>