Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CFRunLoopTimerCallBack by reference?



I need to dispatch a lot of CFRunLoop timers with callbacks to several different functions. I'd like to write a single dispatch function that can specify the callback by *reference* rather than by name. I've never seen this done. Is it possible?

For example:

char* callbackRef = "myCallback";

CFRunLoopTimerRef timer = CFRunLoopTimerCreate (
/* CFAllocatorRef allocator */ kCFAllocatorDefault,
/* CFAbsoluteTime fireDate */ CFAbsoluteTimeGetCurrent() + delay,
/* CFTimeInterval interval */ 0, // 0 = fire once then invalidate
/* CFOptionFlags flags */ 0,
/* CFIndex order */ 0,
/* CFRunLoopTimerCallBack callout */ callbackRef, //----- nooooo way!
/* CFRunLoopTimerContext *context */ &context );


Can argument 6 of 'CFRunLoopTimerCreate' somehow be a reference, or is a const compile-time string the only possibility?

Any suggestions much appreciated!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.