On Sun, Mar 1, 2009 at 9:58 PM, Memo Akten <m...@memo.tv> wrote:
> Michael, so does this mean that CFRunLoopTimer and NSTimer don't behave the
> same way? I always assumed 'toll-free bridged' meant that you could use them
> interchangeably, the NSxxx were just Cocoa wrappers for the CF stuff, but it
> seems behavior is not the same...

Toll-free bridged means that objects of the two classes can be used
interchangeably. In other words, you can do this:

CFRunLoopTimerRef timer = ...;
[timer invalidate];

Or you can do this:

NSTimer *timer = ...;
CFRunLoopTimerSetNextFireDate(timer, date);

But it does *not* mean that two different APIs on either side of the
divide will behave identically. The NSTimer method sends a message to
an object. The CFRunLoopTimer method calls a function. This is
*already* a difference in behavior, and further differences in
behavior should not be any sort of surprise.

Another example: CFDictionarySetValue() will allow you to set a NULL
value, whereas -[NSMutableDictionary setObject:forKey:] will not.
There's nothing unusual about that, they're two different things. TFB
does not say that they will behave identically, it says that you can
pass an NSMutableDictionary to CFDictionarySetValue(), or that you can
send -setObject:forKey: to a CFMutableDictionary.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to