• 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
Re: C callbacks with NSNotificationCenter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C callbacks with NSNotificationCenter?


  • Subject: Re: C callbacks with NSNotificationCenter?
  • From: Jonathan Mitchell <email@hidden>
  • Date: Wed, 07 Sep 2016 17:16:12 +0100

> On 7 Sep 2016, at 17:09, Andreas Falkenhahn <email@hidden> wrote:
>
>
> Still, I'm wondering: Is it also possible to have NSNotificationCenter call
> a C function for me whenever the notification triggers? Can this somehow
> be achieved or am I forced to use full Objective C here?
>
I would go about this by creating a singleton Obj-C object to handle all my notifications.
I would then register C Function pointers with this, perhaps using an NSMapTable or its CF equivalent to track the relationship between the incoming notification and the desired c function.
When the notification comes in I look up my map and call the C function.

HTH

J


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >C callbacks with NSNotificationCenter? (From: Andreas Falkenhahn <email@hidden>)

  • Prev by Date: C callbacks with NSNotificationCenter?
  • Next by Date: Re: C callbacks with NSNotificationCenter?
  • Previous by thread: C callbacks with NSNotificationCenter?
  • Next by thread: Re: C callbacks with NSNotificationCenter?
  • Index(es):
    • Date
    • Thread