Re: do i need to create autorelease pool?
Re: do i need to create autorelease pool?
- Subject: Re: do i need to create autorelease pool?
- From: Michael Ash <email@hidden>
- Date: Mon, 2 Mar 2009 18:20:31 -0500
On Sun, Mar 1, 2009 at 9:58 PM, Memo Akten <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden