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

  • Home
  • SEARCH
  • 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 8288147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:13:22+00:00 2026-06-08T12:13:22+00:00

I used -[NSDictionary getObjects:andKeys:] method first time, and I discovered there’s no policy on

  • 0

I used -[NSDictionary getObjects:andKeys:] method first time, and I discovered there’s no policy on description should I free the memory or not. I think * Returns by reference C arrays* means it’s just a reference to internal memory block, so I shouldn’t free them, but it is not sure. Should I free them?

And I think there’re some conventions about this. What are the convention or where can I find the conventions or rules about C memory management on Objective-C/Cocoa? (of course, I know Objective-C level conventions but I mean case of using C-level objects)

  • 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-08T12:13:23+00:00Added an answer on June 8, 2026 at 12:13 pm

    You do not release the objects or keys. They will be released when the dictionary is released. While this call may be useful in some situations, in general I would try sticking to other methods if you want to iterate all of the items in a dictionary, such as -enumerateKeysAndObjectsUsingBlock or -allKeys.

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

Sidebar

Related Questions

I've used NSNotifications before but this is the first time I've tried to use
I know NSDictionary can be used to return multiple things from a method when
This is the code i have. The NSDictionary did used to be something, but
I need a string->string mapping to be used at runtime (think NSDictionary ), except
I used ReconstructMe to scan my first half body (arm and head). The result
NSDictionary has the following method signature: - (NSArray *)objectsForKeys:(NSArray *)keys notFoundMarker:(id)anObject; My question(s): Is
I used the instruments tool and it tells me I have no memory leaks.
In my app, I have a NSDictionary whose keys should be instances of a
So I am creating a NSDictionary that is feeding a method data to be
I am trying to write a method: - (NSDictionary *)wordFrequencyFromString:(NSString *)string {} where the

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.