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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:35:32+00:00 2026-05-27T23:35:32+00:00

I need to send a distributed notification from my cocoa app to my firebreath

  • 0

I need to send a distributed notification from my cocoa app to my firebreath project, so I need to create an observer and a selector in my firebreath code.
I changed the class extension to “.mm” in order to support objective-c code. I already have objective-c code in my firebreath project and is working ok. But when I try to create an observer I get errors in my code and I don’t know how to resolve it.

Here is my source code from firebreath project:

//This is the selector 
- (void)receiveAppConfirmationNotification:(NSNotification*)notif{
    //The application is alive.
    NSLog(@"The application is alive!!!!!!!!");
}

std::string MyProjectAPI::bgp(const std::string& val)
{       
    //Add an observer to see if the application is alive.
    NSString *observedObject = @"com.test.net";
    NSDistributedNotificationCenter *center = [NSDistributedNotificationCenter defaultCenter];
    [center addObserver: self
               selector: @selector(receiveAppConfirmationNotification:)
                   name: @"App Confirmation Notification"
                 object: observedObject];
}

Here are my errors:

…firebreath/../projects/MyProject/MyProjectAPI.mm:133: error: expected unqualified-id before ‘-‘ token. This is the line where I defined the “receiveAppConfirmationNotification” method.

…firebreath/../projects/MyProject/MyProjectAPI.mm:157: error: ‘self’ was not declared in this scope.

How can I do to define the selector?
How can I do to add the observer as the class itself?

  • 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-27T23:35:33+00:00Added an answer on May 27, 2026 at 11:35 pm

    A selector has to be part of an objective-c++ class; you can’t just throw it in the middle of nowhere there, it should be in the @implementation section of the class.

    To keep things as compatible as possible, I recommend putting both @interface and @implementation sections in the .mm file so that the .h file is compatible with C++, but that’s up to you; it’ll just be easier if you do it that way. You can use the pimpl pattern to help with this if you want.

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

Sidebar

Related Questions

I need to create a distributed application consisting of multiple clients that send files
I am working on a distributed processing project. I need to send my composite
I need send certain attributes(say, human readable user name) from server to client after
I need to send some arguments from the iPhone to a php in the
I need to send emails from my web application (on account creation, password reset,
I need to send a file to MobileMe via Cocoa. I stumbled across a
I am looking to create a distributed framework in Java and need some help
I'm developing a iPhone app and need to send it to my client. In
Need to send and receive a SOAP message in the following format from a
I need create a stored proc that will return a list of a code,

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.