waffle

Hidden Developer Gems in Snow Leopard

  • clang’s Static Analysis is built into Xcode. Build → Build and Analyze, and wonder how you ever accepted that scan-build web interface.
  • Concurrent NSView drawing, opt-in.
  • NSCache provides a data structure tuned for caching, where you associate an item with a cost and items can be silently evicted to maintain a small footprint, or because objects implementing the NSDiscardableContent protocol has proclaimed that the content isn’t actually useful anymore.
  • An alias class, finally. NSURLs are now bifurcated; one half contains an actual URL, and the other can contain alias evidence (under the guise of “bookmark data”) that can help track the file down after it’s been moved. The goal is to completely replace both string paths and FSRef aliases, and as far as I can see, all API has been updated to the point where an NSURL can be used.
  • Sudden termination, where you can flag your app as being constructed in such a way that, aside from specially delineated regions, the process can be instantly killed at any time.
  • NSImage has seen some much needed spring cleaning, including the deprecation of a slew of drawing methods. They’ve gotten closer to CGImageRefs and can be easily snapshotted into one, which may be the reason that CALayers can now take one as their contents.
  • You can enumerate collections concurrently using blocks.
  • Data detectors, as-you-type text replacement and a unified NSTextCheckingResult (text analysis like grammar and spell checking) model are news in NSTextView.
  • NSBrowser is a lot less insane, likely due to Finder’s Cocoa port.
  • Preparations are in place for bi-directional UI.
  • NSTextFields (and cells) can explicitly be set to “single line mode” which ignores any line or paragraph break and fixes the baseline.
  • Core Animation gains a slew of useful layers, including CAEmitterLayer for particle effects, CAShapeLayer for Bézier paths and CAGradientLayer for those of us who wondered why contents didn’t take NSGradients nor CGGradientRefs. You can also animate your layer subclass’s own properties.
  • NSString’s -localizedStandardCompare: provides Finder-like sorting.

Comments [+]

  1. What is a bi-directional UI?

    By David Madden · 2009.08.28 19:35

  2. UI that lays out in reverse order in locales that read right-to-left, like Arabic. A popular example is having scroll bars on the left.

    By Jesper · 2009.08.28 19:42

  3. When you said concurrent nsview drawing, do you mean that it can be drawn by multiple threads each drawing a portion of it? or is it more like a nsview being drawn from another background thread? Thanks.

    By jason · 2009.08.29 09:23

  4. I mean — Apple means that drawRect: can be called outside the main thread:

    /* Sets whether AppKit may invoke the view’s -drawRect: method on a background thread, where it would otherwise be invoked on the main thread. Defaults to NO for most kinds of views. May be set to YES to enable threaded drawing for a particular view instance. The view’s window must also have its “allowsConcurrentViewDrawing” property set to YES (the default) for threading of view drawing to actually take place. */

    - (void)setCanDrawConcurrently:(BOOL)flag;

    By Jesper · 2009.08.29 11:38

  5. The browser actually got the overhaul before Finder. It was just about damn time. (I will admit that the API changes were made with the eminent file browser in mind.)

    By Ben Stiglitz · 2009.08.31 19:36

Leave a comment

Your e-mail address is never shown. If you type a line break in the comment, it will show up as a line break (naturally). The following HTML is allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)


Please note: Your comment will not show up at once. Unless you're spamming or being abusive, you have nothing to worry about. (Read the full policy.)