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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:47:02+00:00 2026-05-26T23:47:02+00:00

In one of my classes I post a notification: [[NSNotificationCenter defaultCenter] postNotificationName:@ALERTNOTI object:self userInfo:nil];

  • 0

In one of my classes I post a notification:

[[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:self userInfo:nil];

In my app delegaate I listen:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMethod) name:@"ALERTNOTI" object:nil];

I use NSLog to track when I send and when the method myMethod gets called.

The method is not getting called despite me sending out the notification.

Is there something that I need to know about NSNotification? Is it tempermental?

  • 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-26T23:47:03+00:00Added an answer on May 26, 2026 at 11:47 pm
     do this changes
    
       [[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:nil];
    
       if you want to pass some object through the notification. then do this
        ex: you want to pass an NSDictionary *dict
    
       [[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:nil userInfo:dict];
    

    the method you want to call via notification should be like this.

      -(void)method:(NSNotification *) notif
       {
          // your code here.
    
          //if you want to access your dict
           NSDictionary *myDict=[notif userInfo];
    
    
    
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of classes in my program uses some third-party library. Library object is a
I've got a simple object post that has two NSMutableArrays as properties. One is
I have two classes, one is Post and the other is Category, with a
I have two classes one of which inherits from the other. Im trying to
I'm executing the java binary from one of my classes, and a ClassNotFoundException gets
I have a field for addedBy in one of my classes. I've set up
Trying to override a tostring in one of my classes. return string.Format(@ name =
I need to validate a certain property to one of my classes. When I
I am using System.Timers.Timer class in one of the classes in my application. I
I'm writing a website that will sell items from one of my classes. It

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.