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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:41:13+00:00 2026-05-28T01:41:13+00:00

So far I have been using NSNotificationCenter with the method postNotification:aString object:anyObjectOfInterestForTheReceiver . But

  • 0

So far I have been using NSNotificationCenter with the method postNotification:aString object:anyObjectOfInterestForTheReceiver. But recently I read in the documentation that the object field should only be passed self. Is there any terrible side effect I am unaware of that should convince me to only pass self in the future, or is it OK to pass any object?
Thank you!

  • 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-28T01:41:14+00:00Added an answer on May 28, 2026 at 1:41 am

    You can pass any object as the object of a notification, but the convention is that the object is the “thing that is doing the notifying” (and you put other relevant state in the userInfo dictionary).

    The reason why it’s mostly self is because usually the object doing the notifying usually wants to reference itself. That way, for example, if you had many Foo objects, and one of them completed a task and sent a notification, anyone observing the notification could just look at object to see which Foo was the one in question. The observer can also choose to observe only notifications from a particular Foo when you follow this scheme.

    It’s also reasonable (though less common) to use something besides “self” when posting a notification– let’s say you’re sending a notification “on behalf of” another object. For example, you could be a singleton controller object that completes a Bar task, and you could send the notification with a reference to the particular Bar as the object. That makes more sense than using the singleton as the object, since there’d be no interesting variance there.

    Again, this is a (useful) convention only. When you make up your own notification, you get to define the “contract” of the notification, which is the name, what kind of object is used as the object, and what’s in the userInfo.

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

Sidebar

Related Questions

So far I have been creating Web Portal but recently I had a request
I have been using IAR so far, but it crashes sometimes and doesn't have
I'm trying to intercept events using Gdk.Window.AddFilter(Gdk.FilterFunc) in Mono. So far, I have been
This has / may have been asked before, but, as far as I remember,
So far I have been using Twisted to simultaneously serve a lot of mobile
I am very new to PHP, so far I have been using the following
I have this code i have been using....but i need a conditional where it
All of my C++ programs so far have been using the command line interface
I have been using Eclipse for R and C++. So far I have not
So far I have been using the WebSite Administration Tool built in Visual Studio

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.