Cocoa Selector As CF Callback Addr?
Cocoa Selector As CF Callback Addr?
- Subject: Cocoa Selector As CF Callback Addr?
- From: Lance Drake <email@hidden>
- Date: Fri, 19 Nov 2004 03:42:13 -0700
There's a great new API demonstrated in the demo 'SimpleReach' project.
In it, there's a local routine that gets notified when net connectivity
changes. The routine in the sample code looks like this in the code:
Boolean ok = SCNetworkReachabilitySetCallback( thisTarget,
MyReachabilityCallback,
&thisContext );
My attempt to convert the source into a Cocoa object went perfectly
until
I got to setting the callback address which was implemented as:
Boolean ok = SCNetworkReachabilitySetCallback(thisTarget,
(SCNetworkReachabilityCallBack)@selector(MyReachabilityCallback:flags:
info:),
&thisContext );
The compiler is quite happy with the construct. Unfortunately, the app
cannot accommodate this call and an exception is immediately generated.
After poking around in the (very often very helpful) ADCRefLib, I could
find see any reason why the runtime situation would be such a disaster.
Can anyone please point me to the particulars that would allow for this
callback to succeed?
Thank you VERY much,
Lance Drake
_______________________________________________
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