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 8020931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:49:40+00:00 2026-06-04T21:49:40+00:00

What is the non-autorelease equivalent of this code? NSString *nsFName = [[NSBundle mainBundle] pathForResource:nsName

  • 0

What is the non-autorelease equivalent of this code?

NSString *nsFName = [[NSBundle mainBundle] pathForResource:nsName
ofType:nsExt inDirectory:nsPath];

  • 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-04T21:49:43+00:00Added an answer on June 4, 2026 at 9:49 pm

    There isn’t one. When you’re using Cocoa, you must have a pool in place:

    Cocoa always expects there to be an autorelease pool available. If a pool is not available, autoreleased objects do not get released and your application leaks memory. If you send an autorelease message when a pool is not available, Cocoa logs a suitable error message.

    Part of the GUI application set-up process is establishing one on the main thread; non-GUI programs need to create one as well.

    If you’re creating your own threads, you need to create and manage an autorelease pool for each of those threads as well:

    Applications that link in Objective-C frameworks typically must create at least one autorelease pool in each of their threads. If an application uses the managed model—where the application handles the retaining and releasing of objects—the autorelease pool catches any objects that are autoreleased from that thread.

    Depending on what else you are doing, you may be able to use CoreFoundation. There’s a CFType, CFBundle, on which NSBundle is built. It has a function CFBundleCopyResourceURL() that may do what you need. If you can translate all your code to Core Foundation, then you can escape using a pool, although — as Ken says — it’s really not the burden that you think it is. You’re probably hitting the disk every time you use pathForResource:ofType: anyways.

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

Sidebar

Related Questions

In non-ARC code retained properties handily take care of memory management for you using
Non-english characters are messed up in a text column. Arabic text looks like this:
A non-elegant, non-flexible way of doing this would be something like this: for path
If I have a piece of code that looks like this: - (void)testSomething {
For non-retained string declarations, are these three lines the same? NSString *list2 = self.map;
Some non-ascii characters get escaped in most html documents. Like this: text: därför html:
It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes
Converting non-negative Integer to its list of digits is commonly done like this: import
This question is the non spam bible. Anyway in addition to that when generating
For non-blocking sockets, I know that recv() will return 0 with no error code

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.