Auto-Release Pools w/ using (Cocoa)

The standard C# using statement has been extended for the Cocoa platform to allow the __autoreleasepool keyword to be used in lieu of another expression. This creates a new Auto-Release Pool for this thread and cleans it up at the end of the using statement.

using (__autoreleasepool)
{
  NSApplicationMain(argc, argv);
}

Refer to the Auto-Release Pool topic in the Cocoa platform section for more details.

Cocoa Only

The using __autoreleasepool syntax is relevant and available on the Cocoa platform only.

See Also