Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8436507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:11:46+00:00 2026-06-10T07:11:46+00:00

According to this Apple page , I’ve read that when interacting with Cocoa on

  • 0

According to this Apple page, I’ve read that when interacting with Cocoa on a POSIX thread that I should create a NSAutoreleasePool.

If you are making Cocoa calls outside of the Application Kit’s main
thread—for example if you create a Foundation-only application or if
you detach a thread—you need to create your own autorelease pool.

Unfortunately, using NSAutoreleasePool is disallowed in ARC.

What should I do then to guarantee that there is always an pool available for any ARC code that is autoreleased?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:11:47+00:00Added an answer on June 10, 2026 at 7:11 am

    Use @autoreleasepool.

    @autoreleasepool
    {
        // make Cocoa calls here
    }
    

    This allows the compiler to reason properly about the lifetime of objects that cross the pool’s boundary, which is a requirement for ARC. (That’s why you can’t use NSAutoreleasePool.) As a bonus, it’s also faster.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this answer I want to create my own subclass of Array QArray
According to Apple guidelines: What url should I use to verify my receipt (iOS)?
According to Apple one should have 2 controllers and 2 nibs in order to
According to the apple documentation, AudioServices.h should be part of the AudioToolbox framework. Even
This is a newbie question that is driving me crazy. According to jQuery mobile
According to Apple's documentation, CGLFlushDrawable or it's Cocoa equivalent flushBuffer may behave in couple
According to the Model-View-Controller pattern, applied heavily in Cocoa Touch, UIViewControllers should always handle
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
I didnt find anything according this issue. Can jaas be used to secure my
I have made a custom suface button according this example: <Button> <Button.Template> <ControlTemplate TargetType=Button>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.