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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:46:14+00:00 2026-06-12T11:46:14+00:00

I cannot find in the documentation how memory is handled for the userInfo dictionary

  • 0

I cannot find in the documentation how memory is handled for the userInfo dictionary of an NSNotification. If you specify one, is this merely a pointer to an existing place in memory, or is new memory allocated to “carry” this data into the notification?

If the latter, it would affect performance if you want to reference a large dictionary; if the former, I would expect that it doesn’t matter how large the dictionary is, since it is already in memory.

Also on this point, if the dictionary is not retained before it is added to a notification, how long does it live? Can we safely assume that the recipient of this notification will have access to this dictionary at the moment it is received, even if the dictionary was not retained prior to sending the notification?

  • 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-12T11:46:15+00:00Added an answer on June 12, 2026 at 11:46 am

    I believe that userInfo object provided to + (id)notificationWithName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)userInfo is retained. And I am sure that not any additional memory will be allocated to store userInfo.

    So object referenced by userInfo will be alive while a notification is not released (send and procedes by all the observers of that notification). Yes, you can assume that the dictionary (or whatever you will provide as userInfo) will be accesible in observers (if, of course, you are not overreleasing it).

    From the Memory Management Programming Guide for Core Foundation -> Ownership Policy

    Instance Variables and Passing Parameters

    A corollary of the basic rules is that when you pass an object to another object (as a function parameter), you should expect that the receiver will take ownership of the passed object if it needs to maintain it.

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

Sidebar

Related Questions

i cannot find any documentation of this project
This is a rather simple question, but I cannot find documentation about it from
I cannot find much documentation of the Boost version of discrete_distribution. After much Google
I’ve gone over the nyroModal documentation and Google, but cannot find a simple solution
I cannot find the solution for this problem, here is the simplified example: On
I cannot find a dictionary entry by key. I have an interface like the
This is a super basic task, but I can't find documentation on it. I
I cannot find any documentation on the kflushd such as what it does exactly,
I cannot find any documentation. All I want to do it set jQuerys default
This is for some reason really hard to find and solve. Cannot find any

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.