• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Solved] Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Solved] Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error


  • Subject: [Solved] Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error
  • From: Vincent Pottier <email@hidden>
  • Date: Tue, 7 Dec 2004 15:14:42 +0100

The problem come from [NSNotificationCenter defaultCenter], it can't be defined in the C function. just add
#define center [NSDistributedNotificationCenter defaultCenter] and then use "center" instead of [NSNotificationCenter defaultCenter].
Thanks for you help
Vincent

Le 7 déc. 04, à 09:30, Robert Cerny a écrit :
Hi,
I maybe wrong but i believe that notifications needs to have a NSRunLoop to work. Check <file:///Developer/ADC Reference Library/documentation/Cocoa/Conceptual/InputControl/index.html>


Robert

On 6.12.2004, at 23:31, Vincent Pottier wrote:

Hello list,
I'd like to do this in a Command line tool:
void callback(u_char *user, const struct u_char *header, const u_char *packet)
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"queuePacket" object:nil userInfo:nil];
}

I always get an error:
*** -[NSNotificationCenter postNotificationName:object:userInfo:options:]: selector not recognized
*** Uncaught exception: <NSInvalidArgumentException>
*** -[NSNotificationCenter postNotificationName:object:userInfo:options:]: selector not recognized

lf I run the same code within a cocoa application I don't get the error. Someone can explain me this issue?

Thanks in advance
Vincent _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Solved] Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error
      • From: j o a r <email@hidden>
References: 
 >[[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error (From: Vincent Pottier <email@hidden>)
 >Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error (From: Robert Cerny <email@hidden>)

  • Prev by Date: Re: Updating an NSPopUpButtonCell menu in an NSOutlineView
  • Next by Date: Re: NSScanner Madness
  • Previous by thread: Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error
  • Next by thread: Re: [Solved] Re: [[NSNotificationCenter defaultCenter] postNotificationName:...] in a C function get error
  • Index(es):
    • Date
    • Thread