2012-02-03 24 views

回答

3

您可以使用CFNotificationCenter從您的dylib發送達爾文通知到應用程序。這是限制性的,沒有用戶數據可以傳遞,但你至少可以通知應用程序的事件。更多關於https://developer.apple.com/library/IOs/#documentation/CoreFoundation/Reference/CFNotificationCenterRef/Reference/reference.html

Example of registering and posting: 


CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL, &NotificationReceivedCallback,(CFStringRef)MyNotificationString, NULL, CFNotificationSuspensionBehaviorCoalesce); 
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter() , CFSTR(MyNotificationString), NULL, NULL, YES);