I have a method in the objective-C class. It has 2 callback functions written in C. The pointer to the ie class selfis passed to these functions as void *. In C functions, I create a type class pointer and assign a parameter void *. The first callback function succeeds. But the pointer void *becomes nilin the second callback function. Note that I did not change the pointer in the first callback, but still I get nilin the second callback.
Any ideas what could be wrong?
For example:
kr = IOServiceAddMatchingNotification(gNotifyPort, kIOFirstMatchNotification,
matchingDict, RawDeviceAdded, NULL,
&gRawAddedIter);
RawDeviceAdded(NULL, gRawAddedIter, self);
It works great. But below the function gets selflike nil.
kr = IOServiceAddMatchingNotification(gNotifyPort, kIOFirstMatchNotification,
matchingDict, BulkTestDeviceAdded, NULL,
&gBulkTestAddedIter);
BulkTestDeviceAdded(NULL, gBulkTestAddedIter, self);
source
share