Well, as I said in my previous post, Apple people don’t maintain AppKit framework as they did before.
So, as a developer you would need to decide functions from which framework to use. What I means is, for example when Apple introduced a feature in Core Graphics, a corresponding NS* class and its messages used the newly implemented feature in Core Graphics. So, you don’t really need to access Core Graphics directly except for some special cases where you need to access those lower level functions than AppKit directly.
However, now you will decide which one to use more frequently than you did so before.
For example, scheduledTimerWithTimeInterval:invocation:repeats of NSTimer doesn’t look to use the timer dispatch_source. if it uses timer dispatch_source internally, you will not need to worry about which one to use. But now you should do so.
There can be some reason you would prefer using NSTimer message.
- You have old source code which was written for OS X earlier than OS X 10.6 Snow Leopard and want to keep the source code
- You want to ensure source code level compatibility with older OS X. ( Well, you would say the version of Xcode required to build for the older OS is not installable on current Mac OS X. But if your company is serious about supporting older but still decent OS X, they should keep the dev. environment for you.
- You want to ensure source code level compatibility with GNUStep. ( I wonder how many people/companies actually care about GNUStep for commercial S/W. )
- You prefer the simple NSTimer use pattern.
However, you would prefer using the timer dispatch_source if you want :
- Better performance and caring of multi-core architecture environment more well presumably
- NSTimer is scheduled in Run-Loop, while dispatch_source is in GCD space. So, inherently dispatch_source will utilize multicore architecture more well, although it could be negligible practically.
- higher timer resolution ( NSTimer is in seconds, while dispatch_source is in nanosecond )
- Probably this is the strongest reason you want to use dispatch_source.
Any other reason to prefer one to the other?