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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:41:20+00:00 2026-05-29T20:41:20+00:00

I am using CFSTR function for creating CFString from constant c string and i

  • 0

I am using CFSTR function for creating CFString from constant c string and i am calling this function very frequently in my Daemon.

From documentation:
A value returned by CFSTR has the following semantics:

  1. Values returned from CFSTR are not released by CFString—they are
    guaranteed to be valid until the program terminates.
  2. You can retain
    and release values returned from CFSTR in a balanced fashion, like
    any other CFString, but you are not required to do so.

Should i use retain and release ?

  • 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-05-29T20:41:24+00:00Added an answer on May 29, 2026 at 8:41 pm

    As the documentation states, CFSTR() created strings remain valid until the program terminates. You can release them all day long, but they won’t actually be deallocated. For that reason, there’s no need to explicitly retain/release them. It’s valid to retain/release them because otherwise, you couldn’t pass them around through other code that retains/releases them (framework methods, etc). Treat them like you would NSString literals created using @"", that is to say, no need to retain or release them after creation, but if you’re writing code that can take any CFString, you need to follow normal memory management rules, including using CFRetain() and CFRelease().

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

Sidebar

Related Questions

I am trying to write a function to convert a std::string to char* .
Say I want to get the HTML of http://www.google.com as a String using some
I'm using the conversion function CStr in VBScript to convert a number of type
With this code I tried to print the string foo 10 times in binary
Using this method here how would I return the curCapacity and maxCapacity mAh values
I am using xcode and this is my sha512 method: -(NSString*) sha512:(NSString*)input { const
Per example below...Looping through an object from a parsed JSON string returns an error
I am comparing two table like this: SELECT * FROM tableA AS A INNER
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.

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.