title: @autoreleasepool expected expression before @ token
body: <p>I have an iOS project which uses ARC, and I'm receiving an error related to the the way I'm creating the app's @autoreleasepool.</p>
  
  <p>In in main.m I have a small snippet of code such that:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  int main(int argc, char *argv[]) {
      @autoreleasepool {
          return UIApplicationMain(argc, argv, nil, @"MyAppDelegate");
      }
  }
  </code></pre>
  
  <p>And I receive the error message:<br>
  <strong>error: expected expression before '@' token</strong></p>
  
  <p>However if I revert to the old style of creating an autoreleasepool:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  int main(int argc, char *argv[]) {
  
      NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
      int retVal = UIApplicationMain(argc, argv, nil, nil);
      [pool release];
      return retVal;
  }
  </code></pre>
  
  <p>I receive various errors related to ARC in the IDE specifically:</p>
  
  <ol>
  <li>NSAutoreleasePool is unavailable: not available in automatic reference counting mode</li>
  <li>ARC forbitds explicit message send of 'release'</li>
  </ol>
  
  <p>However when I attempt to build, it builds successfully.  </p>
  
  <p><strong>Where is the conflict?<br>
  How can I get it to use the new style of creating the auto-release pool?</strong></p>