Matt Legend Gemmell Modesty is Lying

Mac OS X Cocoa and iPhone Development Services available at Instinctive Code.
Mac OS X Cocoa and iPhone Developer for hire

Other Pages

Categories

Get rid of your code with Leopard

As Cocoa developers, whenever we get a major new release of Mac OS X, we have to spend time familiarising ourselves with the new APIs and facilities on offer. One of the main goals of this investigative process is to identify controls and funtionality which we previously had to implement ourselves, but which are now provided natively for us.

I’ve been using Leopard for the last few months, and I thought I’d post a partial list of new and improved APIs which may be of interest to Cocoa application developers. I’m going to classify these in terms of what you can do with them, rather than by class-name or other such relatively obscure aspect, and I’ll include some screenshots where appropriate. Please feel free to add your own observations via the comments. I’ll stick roughly to the order used in the AppKit and Foundation release notes, which you should also read if you’re serious about getting the skinny on what’s new in Leopard.

Naturally, backwards-compatibility does complicate matters somewhat, but that doesn’t detract from the usefulness of getting a quick high-level overview of the new toys we now have to play with.

Update: Added some new screenshots and clarifications, and mention of a couple of the new frameworks available. Oh, and welcome to all Daring Fireball readers - I knew it was taking longer than usual to pull down my server logs. ;)

Core Animation

This one needs little introduction. Spend some time with the documentation, paying particular attention to the concept of layer-backed views and the animator proxy. You can do some incredible things simply by setting up properties in Interface Builder, and can usually get a very convincing animation simply by sending a message to [yourView animator] instead of just to yourView.

Cover Flow screenshot

Take a look at NSAnimatablePropertyContainer to add your own animatable properties to views too.

Cocoa Slides screenshot

(Note: both of these examples, “Covert” Flow and Cocoa Slides, are part of the Core Animation Coding Headstart sample code. I believe it’s still just available to those with access to the Leopard seeds, but hopefully/presumably it’ll become publicly available soon.)

View drawing

You’re now notified (via methods you can override in a subclass) when a view is hidden, unhidden, or is about to draw. This will help you do more efficient pre-calculations and caching for your drawing code. You can also now directly manipulate all of a view’s subviews at once.

Working with Quick Look

You can create Quick Look Plugins which allow Quick Look to preview the content of your app’s custom documents, in the same way as Tiger allowed you to add Spotlight Plugins to allow indexing those documents.

You can also request a Quick Look-generated preview of a document using QLThumbnailImageCreate() from the QuickLook framework (thanks to Mek for pointing that out). The preview can be of an arbitrary size you specify, of any document you like, and you can even tell the framework to draw it as an “icon” (i.e. with a drop-shadow, document page-curl and so on).

Managing multiple views (for custom tab controls, or such)

There’s a new NSViewController class that lets you manage a set of views, and supports bindings. It might eliminate a lot of glue code to swap views in response to user interaction.

iPhoto-like animating grid of images or views

You get this for free with IKImageBrowserView. Try setting one up in Interface Builder and run the simulation; it’ll work right then and there. The example shown below (and the default behaviour of the control in Interface Builder) is a zero-code, nib-only view of your desktop pictures, supporting multiple selection, automatic re-tiling and animated drag-reordering.

IKImageBrowserView screenshot

Note that IKImageBrowserView is a pre-made control using the new NSCollectionView class; see its documentation for more details (it used to be called NSGridView in earlier seeds, but that name has been changed to NSCollectionView). There’s also a sample app for the new PubSub framework which uses IKImageBrowserView; you can find it in /Developer/Examples/PubSub/NewMusic/ (thanks to Jens Alfke for the note).

Setting up your own Smart Groups/Playlists/Folders

You can use the NSRuleEditor and NSPredicateEditor classes to get the familiar rule-editing interface for your app.

NSPredicateEditor screenshot

Putting custom views in menus

NSMenuItem now has a -setView (and a -view) method, to put arbitrary views in your menus without resorting to Carbon. Animation via timers will work too, but pay attention to the runloop you use (it has to be the event-tracking runloop mode, since it’s in a menu).

Screenshot of NSMenuItem containing NSView

Menu improvements

You’ll now be notified (via delegate methods) when a menu-item is opened, closed, highlighted and unhighlighted - this is very handy for custom view menu-items, but applies to all items.

You can now have the same keyboard shortcut in multiple menus as long as the action of all items with that shortcut is the same (good for contextual menus duplicating commands in the menubar), and (significantly) if a shortcut would trigger a disabled item, your app now gets the chance to handle that shortcut anyway. This could remove the need for some trivial NSApplication subclasses.

Printing UI

The Print panel is much improved, particularly in terms of accessory view support; your app can really get in there and customize what’s shown. If printing is a significant part of your app’s functionality, you need to take a fresh look at NSPrintPanel and NSPageLayout - there’s a huge amount of new material and functionality there.

Uniform Type Identifiers

Leopard now richly supports using UTIs throughout the document architecture, including NSDocument, open/save panels, bundle info, NSWorkspace and so on. Ditto for drag-types, pasteboard data, services definitions, image types, and a host of others. If you’re looking to simplify and unify how your app classifies data types without using lots of arbitrary constants, take a look.

Get splitviews like those in Mail etc

NSSplitView has been significantly enhanced; read through the API and you’ll see that it’s much better about programmatic collapsing, changing divider thickness and active area, and even specifying an external area which acts as a proxy draggable zone to move the splitter (just like the little thumb in Mail and many other apps). There are also bug fixes in there for things like the long-standing progressive rounding errors when resizing.

(And if it’s still not up to scratch, you can of course continue to use RBSplitView.)

Putting document icons in the titlebar

You don’t need to be using the NSDocument architecture for this; there are new methods to control the icon, what it represents, whether the popup menu appears, and so on.

HUD windows, like in iPhoto’s palettes

There’s now a HUD Window type, which is an NSPanel. It can even be borderless, and still get the transparent black background and so on. This might let you get rid of custom window subclasses (like some of mine, for example).

HUD window screenshot

Controlling the texture/metal on your windows, and where it draws

There are now methods to determine the “border thickness” of the texture on your windows; you can say that, for example, there should be texture on the bottom 100 pixels or such. This can remove the need for custom window subclasses, or superfluous views which only draw a background.

Integrating with Spaces

Your windows can choose what happens when they are made visible on a certain Space, and when the user switches Spaces. Basically, you can choose whether it uses the default behaviour (appears on one space, stay there unless moved explicitly), or always appears on the active space, or appears on all spaces. See NSWindowCollectionBehaviour for more.

“Don’t Show Again”

If you wanted this behaviour (usually a checkbox at the bottom of an alert dialog, to suppress showing the alert next time), you had to roll your own. In Leopard, NSAlert supports it natively, and also lets you add arbitrary accessory views. This should eliminate a lot of custom windows in nibs and glue code. See NSAlert’s -setShowsSuppressionButton: and -setAccessoryView: methods.

NSAlert screenshot showing a suppression checkbox

Dock icons for windows and apps, including badges and counts

There’s a new NSDockTile class allowing you to control the dock tile for a minimized window and/or for your app itself. It supports adding or removing the app-icon badge, and also setting a custom badge label, say to show progress or some other status display. This could eliminate a lot of code to create a custom image for the dock, and compositing other stuff into that image.

Tracking the mouse properly

As I previously alluded to, Leopard has a much better alternative to the rather weak and unreliable cursor-rects: NSTrackingArea. Use it to get precise and solid tracking of the mouse (both entered/exited and/or moved), even when your app isn’t active.

Even more text formats

The text systems deals with OASIS Open Document files and ECMA Office Open XML files, and a newer version of Word files too, so you can add a few more Import and Export options to your app for free.

Layout manager improvements

If you’re explicitly using NSLayoutManager for anything, you should know that it now supports non-contiguous layout. This could be a massive performance improvement for your app, if you’re willing to take the time to learn how the implementation has changed. Some very welcome additional minor improvements include getting the baseline offset for a given font, and the ability to display invisibles natively.

Safari 3-style Find results popup

Safari 3 has a nice visual indicator for the results of a Find operation; it’s like a yellowish lozenge shape which pops up over the body of text you’re searching. You have access to this too, via showFindIndicatorForRange: in NSTextView. Use it for good, rather than evil.

Find results indicator screenshot

Smart links, quotes, and inline image editing

NSTextView supports all these things now, including tooltips for links. You can even query an NSAttributedString to see if it has found an URL at a given position. This could get rid of a lot of custom NSText* object subclasses.

Smart Links and quotes screenshot

Do good grammar

You might have noticed the new grammar checker (wiggly green underlines) in the Cocoa text system; you have access to it in all the same ways as you’ve had access to the spelling checker for some time now, including providing your own suggested grammatical improvements.

Grammar checker screenshot

Get rid of a lot of unnecessary bitmaps of buttons

If you have custom buttons in your app, you probably have a lot of bitmaps for the normal state, pressed state, and so on, and a bunch of code to tie it all together. Leopard can help you get rid of it, via NSImage’s -isTemplate and NSCell’s -backgroundStyle additions. Read the docs to find out what it’s all about, but essentially:

  • You can specify one bitmap and tell Cocoa that it’s a kind of “mask”, and Cocoa will take care of making it glow in appropriate situations (like the show/hide mini-calendar/tasks buttons in iCal).
  • You can tell NSCell how to draw your text, in terms of what kind of background it’s on: dark, light, raised, or lowered. This gets you stuff like the Bookmarks button in Safari (with all its different highlighted/unhilighted/etched/embossed appearances) with only one bitmap.

This is potentially a significant win in terms of app size, memory usage, and your graphics budget. See the documentation for more. Note that NSStatusItem also supports this stuff, so you can potentially get rid of your one-black-and-one-white images there too.

Free images and icons

We’ve all stolen Apple’s icons for things; now we’re officially allowed to. There are lots of new standard images available via NSImage -imageNamed:, including the Safari bookmarks image, all kinds of arrows, the gear icon, the Computer icon, Bluetooth and Bonjour logos, user account icons, the Info icon, and many more. The size of your app could drop significantly, as could your icon-design expenditure. (And don’t worry: NSButtonCell now supports an imageScaling parameter, in case those icons change size in the future).

Standard icons screenshot

If you want to play with these in Interface Builder, drag an NSImageView into a window and use the Inspector to set the image using the combo-box; it now lists all the newly-available standard ones.

Drawing complex images and areas by tiling smaller images

Leopard now has two functions called NSDrawThreePartImage() and NSDrawNinePartImage(), which let you easily draw images which have two fixed-width end-caps and one tiled variable-width middle section, or images which have four corner images, four tiled side images, and a tiled central image. These functions are smart about resolution-independence, and could probably replace about twenty or more lines of your code every time they’re used.

Groovy boxes

NSBox now supports custom background and border colors, and your choice of border width and corner radius. One more custom control subclass you can throw away.

Gradients that aren’t by Chad Weider

Everyone in the Cocoa development world uses CTGradient, and it’s rather awesome. In Leopard, Apple finally catches up with Chad and offers us NSGradient. Check out its methods designed to help you build gradient-editing UI too.

TableViews and OutlineViews enhanced

I’ve often had to create NSTableView subclasses to let me edit the contents of cells (like checkboxes or such), without visually selecting the whole row. Leopard fixes this by letting you choose whether to “track” a cell independent of its editable status. We now have delegate methods to let us support type-to-select natively, both these controls properly support a disabled state, and have a host of improvements in handling drags, contextual menus and inline editing.

If you want that iTunes/Finder-sidebar look, with the etched group titles amongst the rows, you’ve got that too - you can now have “full-width” cells. You can probably get rid of a bunch of custom subclasses of NSTableView, NSTableColumn, and several NSCells.

Source lists

We’ve been talking about these for years now, and Leopard finally gives you that highlight style in both NSTableView and NSOutlineView. Feel free to make the next iSomething without resorting to custom code.

iTunes Music Store-like path display

The new NSPathControl (and its Cell and ComponentCell cousins) let you have a display like the “breadcrumbs” in the iTunes Music Store, which can also be configured to display as a popup menu or like the Path Bar at the bottom of Finder windows in Leopard. Give it a try in Interface Builder.

NSPathControl screenshot

Image editing for free

IKImageView (available in Interface Builder) gives you an image view that supports an Image Editing HUD palette, and Preview-style cropping, selection, moving, annotation and more, all with zero code. There’s no reason not to have basic image-editing built into your app wherever you’re dealing with images now.

Image Editing HUD screenshot

PDF viewing and browsing for free

Similarly, PDFView (which was already available in Tiger; thanks to Peter Hosey for the correction) gives you Preview-style browsing, selection, zooming and so on for PDFs, and the new PDFThumbnailView even gives you the list of pages down the side. Again, zero code.

Finally unload those bundles

NSBundle now supports unloading. Yes, seriously. Save some memory.

Get info on memory and processors

NSProcessInfo can now tell you the amount of -physicalMemory and also the -processorCount and -activeProcessorCount, without going into Carbon.

Easier priority queues

Take a look at NSOperation and NSOperationQueue (includes dependency management). It could perhaps replace your home-grown implementation.

Displaying dates

NSDateFormatter has a host of new symbols (like era names, e.g. “Anno Domini”, quarter names, and new short variants for weekdays, months, etc). This could remove a bunch of hard-coded arrays in your display code if you do a lot of work with dates and calendars. NSCalendar now also has your back for calculating the start and range of a given unit of time around the current moment (like the start of the current week, or month).

String encodings

NSString has a series of new supported encodings. If you do a lot of conversion between string formats, see if Leopard can’t take over some of the heavy lifting for you.

More efficient expressions in Core Data

NSExpression now supports subquery, aggregate, union, intersect and minus expression types. This means you can save both memory and potentially a lot of code where you previously had to fetch more objects than you needed and filter them yourself. Should be faster, more scaleable, and require less code - definitely check it out if you’re using Core Data with an SQL store.

Scripting support

There are too many improvements to scripting handling to even mention here; please read the Foundation release notes (towards the end) if you use scripting in your app. You’ll be able to remove a lot of nasty workaround code, guaranteed, and you’ll get much more sensible, readable error messages in many cases too.

Working with iCal calendars and other data

The Calendar Store framework lets you access, edit and update iCal data like calendars, tasks, and events, and it’s very easy to use. Supports filtering and searching too, of course.

RSS feeds

Check out the PubSub framework if you need to pull down and parse RSS feeds easily; there are examples in /Developer/Examples/ for you to get started with.

Interface Builder

Lastly, and hopefully this goes without saying: check out the new and improved objects in Interface Builder. You have some amazing stuff there for nothing, including Automator-related views, AppleScript editor fields, the ability to create your toolbars visually, movie-capturing, and lots of Quartz Composer-related stuff. There’s even a bindings-compatible NSDictionaryController to let you edit the contents of an NSDictionary in an NSTableView, which could eliminate a lot of your controller code.

Interface Builder 3 objects palette screenshot

Oh, and there’s an improved API for creating your own IB objects/palettes, so take a look at that too if you’re interested in contributing back to the developer community, or just making your own dev process a little easier with commonly used custom controls.

Whew

That should just about do it for now; I’m sure you want to go and play anyway. Take some time to have a look through Xcode and Interface Builder and get up to speed with the new tools at your disposal - it could make the development time on your next project a lot shorter.


61 Comments

[...] As could my monthly income! But no, I’ve got more than enough interesting work on my hands. Matt has a fantastic (and that’s a horrible understatement) write-up of some highlights in the Leopard feature lineup of developer tools and API’s. Read his long and bookmark-worthy post here. [...]


Peter Hosey
28 October 2007 @ 10pm

PDFView is in Tiger, too. PDFThumbnailView is new, however.


Hello Gradients and Source Lists
28 October 2007 @ 11pm

[...] Matt Gemmell details all the code you can delete from your Cocoa projects with Leopard. NSGradient, table and outline view source lists, and lots more. [...]


Mark
28 October 2007 @ 11pm

This is all great stuff - I can see a lot of developers dropping support for Tiger very quickly, and I’m not sure whether that’s a bad thing.


Cocoa Puff
28 October 2007 @ 11pm

Still no native support for regular expressions?


Thomas
28 October 2007 @ 11pm

And NSBrowser which finally has support for drag & drop (it saves lots of sub-classing code).


[...] jpoynton wrote an interesting post today onHere’s a quick excerpt [...]


Tadpole
29 October 2007 @ 1am

Any word on whether we have access to Quick Look (not just thumbnails, but the actual ability to launch it from within our apps).


Tom Lopes
29 October 2007 @ 1am

>Modesty is Lying

Or inadvertent honesty


Matt Legend Gemmell » Blog Archive » Get rid of your code with Leopard…

Matt Legend Gemmell » Blog Archive » Get rid of your code with Leopard…


Callum
29 October 2007 @ 2am

Hey - thanks a lot for posting this. I’m still waiting for apple to open up the online docs on leopard … for ie, there’s basically nothing on IKImageBrowserView in google at the mo. Unfortunately, the few sample code projects I’ve tried (installed with devtools) wouldn’t even compile! Lots of NSInt (which I’m assuming has been replaced with NSInteger) and LK[...] (replaced with CA).

I’m really impressed with IB3, but it is kinda disappointing to have so few examples to work with.

Feel free to post some tutorials on some of the new stuff ;)


Jens Alfke
29 October 2007 @ 3am

Wow! I’ve been running Leopard for two years and I didn’t even know about a few of these things (like NSViewController and ‘don’t show again’ for alerts.) Nice list.

@Callum: Look in /Developer/Examples/ for up-to-date sample code. (The NewMusic app in the PubSub folder uses IKImageBrowserView.)


[...] Yeah, so this explains why the naysayers on Leopard should shut the hell up a bit. I can’t wait for the influx of new 0.X software releases. [From Matt Legend Gemmell » Blog Archive » Get rid of your code with Leopard] You can skip to the end and leave a response. Pinging is currently not allowed. [...]


Justin Bur
29 October 2007 @ 4am

This article is a welcome reminder and enticement to read the AppKit and Foundation release notes in detail. Apple does good developer release notes, and some of the information in them never makes it into the standard documentation!

(Note to Jens Alfke: A few of these things have been added over the course of Leopard development – that could explain why you didn’t know about them before. :-)


Tony
29 October 2007 @ 5am

Fantastic! I really need to find a good book. I’ve been reading the documentation that Apple has published for now.

I tried to submit this to digg, but submit seems to be broken. At least it’s on reddit.


Ben
29 October 2007 @ 10am

Thanks so much for putting this together, a lot more concise and useful than any of the apple-supplied lists!


Liam Clancy (metafeather)
29 October 2007 @ 10am

Any further info or resources on this?:

“Free images and icons
We’ve all stolen Apple’s icons for things; now we’re officially allowed to.”


Ankur
29 October 2007 @ 11am

Hey, thanks for the list!

I haven’t got Leopard yet, but I’m glad to see a lot of this is available. The NSGradient class will be especially useful.


Matt Legend Gemmell
29 October 2007 @ 12pm

Peter: thanks for the note re PDFView; I’ve updated the article to clarify.

Cocoa Puff: Not that I’m aware of offhand, but there are plenty ways to integrate regexps with your app; check out this page.

Tadpole: you can write Quick Look plugins to allow Quick Look to preview your custom files, but I’m not aware of a way to invoke the panel programmatically. I’ve not checked into it in detail though; I’ll update the article if it turns out to be available.

Liam: to quote the AppKit release notes on Leopard: “Leopard includes a number of standard images that developers may find useful. These images are available as names for use with -[NSImage imageNamed:]. For example, NSImageNameBookmarkTemplate is the image used in Safari for the button that shows the bookmark collections view. See NSImage.h for all of the names.”

You can also play with the images using an NSImageView in Interface Builder.


[...] EDIT: Also check out Matt Gemmell’s partial list of 43 leopard-only development features - use any of those and your application becomes Leopard only. [...]


Mac OS X Leopard - my story so far
29 October 2007 @ 1pm

[...] Interface Builder seems to be rewritten, with designers for toolbars, drawers, core animation, transparent windows… [...]


mek
29 October 2007 @ 4pm

> Any word on whether we have access to Quick Look (not just thumbnails, but the actual ability to launch it from within our apps)?

I asked about this at WWDC, explaining that it was rediculous to ask developers to support quicklook but not letting us use it. Guess what they listened (to me and probably a dozen of others)! Look at QLThumbnailImageCreate


Matt Legend Gemmell
29 October 2007 @ 5pm

Mek: awesome, thanks for that. Article updated to mention it.


[...] I asked Matt Gemmel about this and he points to QLThumbnailImageCreate() for requesting Quick Look-generated previews of files. I’m still not sure if this is only small thumbnails, or the larger previews Finder gives in a HUD when spacebar is pressed. I’m assuming that it’s both. [...]


Jordy/Jediknil
29 October 2007 @ 5pm

This makes me really regret my prior (and standing) decision to continue supporting older versions of OS X…especially when I’m in the process of rewriting an app right now.

Seriously, I almost want to invent an app just to use some of these new features. But then again, that’s what I said about CoreData too…and I still haven’t used it for anything real.


Steven Fisher
29 October 2007 @ 6pm

I am actually pretty disappointed in the final look for the new Find indicator. I’ve been grinding an axe about the 1980-style Find for years now, and was very impressed with the solution in the Safari 3 beta. However, Leopard’s final look for this is a step backwards as far as I’m concerned. In trying to make it more subtle, they’ve made it less usable. And at the same time, why would they think that Find should be subtle?


[...] Get rid of your code with Leopard: I’ve been using Leopard for the last few months, and I thought I’d post a partial list of new and improved APIs which may be of interest to Cocoa application developers. I’m going to classify these in terms of what you can do with them, rather than by class-name or other such relatively obscure aspect, and I’ll include some screenshots where appropriate. Please feel free to add your own observations via the comments. I’ll stick roughly to the order used in the AppKit and Foundation release notes, which you should also read if you’re serious about getting the skinny on what’s new in Leopard. [...]


[...] whether you haven’t seen that roundup yet, Matt Gemmell’s huge list of everything Leopard can do for developers is pretty amazing. It’s a bit on the technical side, but distress not– about 1/4 of the way down the page you’ll think that that is a list only for developers, and whether you keep scrolling you’ll start to see that (somewhere around the “HUD windows” part) Apple has broken open nearly all of their interfaces to developers of all makes and models. Everything from menus to term formatting is updated in Leopard’s developer applications, and there’s lots of “freebies” that will invent even smaller programs better– icons and images, an image editor, and a built-in grammar checker can all be easily implemented in any Leopard apps. [...]


[...] If you haven’t seen this roundup yet, Matt Gemmell’s huge list of everything Leopard can do for developers is pretty amazing. It’s a bit on the technical side, but worry not– about 1/4 of the way down the page you’ll think that this is a list only for developers, and if you keep scrolling you’ll start to see that (somewhere around the “HUD windows” part) Apple has broken open almost all of their interfaces to developers of all makes and models. Everything from menus to date formatting is updated in Leopard’s developer applications, and there’s lots of “freebies” that will make even smaller programs better– icons and images, an image editor, and a built-in grammar checker can all be easily implemented in any Leopard apps. [...]


Yong Hwee
30 October 2007 @ 5am

Cool! I enjoyed this article.


[...] If you haven’t seen this roundup yet, Matt Gemmell’s huge list of everything Leopard can do for developers is pretty amazing. It’s a bit on the technical side, but worry not– about 1/4 of the way down the page you’ll think that this is a list only for developers, and if you keep scrolling you’ll start to see that (somewhere around the “HUD windows” part) Apple has broken open almost all of their interfaces to developers of all makes and models. Everything from menus to date formatting is updated in Leopard’s developer applications, and there’s lots of “freebies” that will make even smaller programs better– icons and images, an image editor, and a built-in grammar checker can all be easily implemented in any Leopard apps. [...]


[...] Ma Mac OS X 10.5 ha introdotto almeno altrettante migliorie dedicate agli sviluppatori, offrendo (senza sborsare un centesimo in più, va sottolineato) soluzioni sempre più potenti per lo sviluppo di applicazioni residenti. Matt Gemmel, sul suo blog, offre un’ottima analisi dello stato dell’arte di Mac OS in questo campo, analisi condita da considerazioni che vale la pena di riportare: PUBBLICITÀ PUBBLICITÀ “[…] Ogni volta che ci troviamo di fronte ad una nuova versione di Mac OS X, come sviluppatori dobbiamo investire un certo quantitativo di tempo per familiarizzare con le nuove API ed infrastrutture messe a disposizione. Uno degli obiettivi di questo è l’individuazione di controlli e funzionalità che in precedenza dovevamo costruirci da soli, ma ora sono lì a nostra disposizione. […]“ [...]


CWhyatt
30 October 2007 @ 7am

Nice article, I can’t wait to get my hands on a copy of Leopard…

It is quite interesting that the debate goes on about Apple and hackers, this time to do with Leopard and PC’s. This article makes quite an interesting read, looking at why hackers would want to do this…

http://www.ameinfo.com/136363.html


Joris Kluivers
30 October 2007 @ 8am

Two things I look forward to using (when I finally get my Leopard DVD):
- Automator framework to use automator workflows from within my application
- Core Data & Sync Services, much easier to sync data stored in core data.


David Portela
30 October 2007 @ 8am

Hey Matt, great article. Congrats on all the traffic, hope the server holds up! :-)


webtuga
30 October 2007 @ 9am

Leopard is the best OS for development!!

WAH!


[...] Aquí hay varios ejemplos (con todo y fuente) como: [...]


R.I.P Toxic Progress Indicator
30 October 2007 @ 1pm

[...] Thanks to Matt Gemmell for pointing out that Apple has finally provided a pie chart style NSProgressIndicator for the circular/determinate modes. This style is new to Leopard. This means my Toxic Progress Indicator class can be retired, at least for 10.5+ only applications. Leopard has really helped to retire a lot of my code (for example my QuickTime Sequence Grabber code can probably be retired too) and I expect this trend to continue. [...]


Josh
30 October 2007 @ 2pm

@Callum: I had the same problem until I realized that all of the documentation is already available in the (new?) developer documentation browser - Xcode->Help->Documentation


Brian
30 October 2007 @ 5pm

Cocoa Slides can be found on your Leopard install already.

Have a look in:
/Developer/Documentation/DocSets/
com.apple.ADC_Reference_Library.CoreReference.docset/
Contents/Resources/Documents/samplecode/CocoaSlides

I was poking around the docs and happened to stumble on it.


Brian
30 October 2007 @ 5pm

About Cocoa Slides, it wont compile! Looks like its using old framework prefix names but the framework contains CAAnimation.h. So I am guessing that they didn’t intend to ship the example but it got stuck on there anyway.


Matt Legend Gemmell
30 October 2007 @ 5pm

Brian: a big Oops on Apple’s part there; seems like an old version indeed. The version available on the Leopard seed site is fine, but I guess you can edit the broken one to fix it too.


ken
30 October 2007 @ 8pm

It’s probably worth mentioning that the Cocoa-level stuff is covered in the AppKit, Foundation, and Core Foundation release notes. These are required reading because of changes that can affect the behavior of apps when they recompile, so give ‘em a look!

Thanks for the overview!


ken
30 October 2007 @ 8pm


[...] If you haven’t seen this roundup yet, Matt Gemmell’s huge list of everything Leopard can do for developers is pretty amazing. It’s a bit on the technical side, but worry not– about 1/4 of the way down the page you’ll think that this is a list only for developers, and if you keep scrolling you’ll start to see that (somewhere around the “HUD windows” part) Apple has broken open almost all of their interfaces to developers of all makes and models. Everything from menus to date formatting is updated in Leopard’s developer applications, and there’s lots of “freebies” that will make even smaller programs better– icons and images, an image editor, and a built-in grammar checker can all be easily implemented in any Leopard apps. [...]


TimothyP
30 October 2007 @ 10pm

A very useful overview.
I’m getting my first book on Mac OS X Programming somewhere this week
(Beginning Mac OS X Programming from Wrox) and I can’t wait to get started.

I’m a C# .NET/Mono developer so it’ll take some time to adjust I assume…


[...] Matt Legend Gemmell » Blog Archive » Get rid of your code with Leopard (tags: cocoa leopard programming osx mac development api apple article code feature) [...]


Robert McGovern
31 October 2007 @ 12am

Seems they have cottoned onto the existence of the CocoaSlides example in the docs. I had the documentation auto update earlier this evening and there is no sign of the sample code.

What there is, is an Animation overview at /Developer/Documentation/DocSets/com.apple.ADC_Reference_Library.CoreReference.docset/
Contents/Resources/Documents/documentation/GraphicsImaging/Conceptual/
Animation_Overview/ChooseAnimTech/chapter_5_section_3.html

Which links off to

http://developer.apple.com/samplecode/CocoaSlides/index.html#//apple_ref/doc/uid/DTS10004072

Which seems to work with the free ADC sign on. From the looks of it though I am guessing it is still the same code though because it fails to compile.

CocoaSlides
Version: 1.1
Posted: 2006-10-24


Troy Stephens
31 October 2007 @ 1am

You can expect an updated version of the CocoaSlides code sample to be published shortly (probably within the next day or two). -Troy @ Apple


[...] Interessant stukje over de nieuwe features in Leopard:Get rid of your code with Leopard. Vooral de veranderingen met betrekking tot Quartz zijn spannend.. ‘k moest toch maar eens wat meer d’r mee gaan doen dan alleen wat screensavertjes in elkaar klussen.. [...]


[...] Interessant stukje over de nieuwe features in Leopard: Get rid of your code with Leopard. Vooral de veranderingen met betrekking tot Quartz zijn spannend.. ‘k moest toch maar eens wat meer d’r mee gaan doen dan alleen wat screensavertjes in elkaar klussen.. [...]


[...] Ma Mac OS X 10.5 ha introdotto almeno altrettante migliorie dedicate agli sviluppatori, offrendo (senza sborsare un centesimo in più, va sottolineato) soluzioni sempre più potenti per lo sviluppo di applicazioni residenti. Matt Gemmel, sul suo blog, offre un’ottima analisi dello stato dell’arte di Mac OS in questo campo, analisi condita da considerazioni che vale la pena di riportare: fonte Melablog  di Marcello Majonchi “[…] Ogni volta che ci troviamo di fronte ad una nuova versione di Mac OS X, come sviluppatori dobbiamo investire un certo quantitativo di tempo per familiarizzare con le nuove API ed infrastrutture messe a disposizione. Uno degli obiettivi di questo è l’individuazione di controlli e funzionalità che in precedenza dovevamo costruirci da soli, ma ora sono lì a nostra disposizione. […]“ [...]


[...] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. Leave aReply [...]


Welcome to Leopard!
1 November 2007 @ 3am


[...] Matt Legend Gemmell » Blog Archive » Get rid of your code with Leopard AppleInsider | Road to Mac OS X Leopard Server: Collaborative Info Sharing Services [Page 3] AppleInsider | An Introductory Mac OS X Leopard Review: Developer Tools [Page 3] Theocacao: A Quick Objective-C 2.0 Tutorial Leopard Sample: A Bound NSCollectionView [The .NET Addict’s Blog] [...]


[...] After reading this article on throwing away code, I noticed the trends in OS X: Automator is much more powerful, Universal Access can now ‘watch’ parts of the screen for changes, an increasingly powerful Interface Builder as part of the development kit, a more powerful Quartz Composer. It’s time for the home software knitting machine. [...]


C. Bess
3 November 2007 @ 1pm

Great overview Matt! Leopard programming, just got a lot more fun and friendly. Are Mac programmers spoiled?


[...] There have also been a ton of improvements to the development side of things. XCode just feels a lot more substantive and less like an open-source development app. And looking through the Interface Builder has all kinds of new items you can drop into your apps, with extremely sophisticated stuff you get “for free.” Matt Gemmell’s blog has a post about all the stuff that’s included with Leopard that developers formerly had to do “by hand,” and it’s pretty astounding. It also makes me wish I weren’t in the middle of deadlines, so that I had some time to play around with it. I wrote a simple image editor a while back, and it looks like Apple has included all the functionality of my editor in a simple widget that you can drop into any app. [...]


[...] A great article for developers: Exploring Leopard with DTrace.  And Matt Gemmell has a fantastic rundown of all the great new Leopard features and API’s in his Get rid of your code with Leopard.  I wish there were easier ways to use all of them without inexorably tying your software to 10.5, though. I’ve resorted to loading the QuickLook framework dynamically in DFX 4 so I can use it while still retaining Tiger compatibility, but that’s an easy case because there’s really only one API call I have to manually look up.  Weak linking helps (thanks Apple!) but I don’t have a good structure set up for integrating a more complex framework without a lot of painful code.  Anyone have any ideas out there?  And no, “force your users to upgrade to Leopard” is not a viable answer in my book. [...]


Troy
5 November 2007 @ 9pm

FYI for anyone still following this: An updated version of the “CocoaSlides” code sample has been published, and can be found at:

http://developer.apple.com/samplecode/CocoaSlides/

The new version, 1.4, works as intended on the shipped build of Leopard.


Max
20 November 2007 @ 7am

hey matt,

i am just working with interface builder and i am just not getting it how to style the buttons to fit hud windows? is there some stupid button i am missing? how did you fit the sliders as well - they probably have the same way of how to change them - but i dont know it :-(

thanks,

max


Leave a Comment

Mac OS X 10.5 Leopard How to get a Quick Look preview as an NSImage