Archive for the ‘Apple’ Category

Leopard Developer Application Technologies Overview

The Application Technologies Overview is the third instalment in the Leopard Technology Series for Developers and was partly authored by James Duncan Davidson.

It briefly covers integrating your application with Time Machine, iChat, and Calendar Store. More interesting is the new Scripting Bridge. It’s a replacement for using AppleScript in your app to communicate with another app. The “Scripting Bridge uses native Cocoa data types, such as NSString and NSArray, requires far less code than using an NSAppleEventDescriptor, and runs more than twice as fast as a precompiled NSAppleScript”. An example is given for getting the current track name from iTunes.

NSString *currentTrackName = [[iTunes currentTrack] name];

As far as I know, the Scripting Bridge hasn’t been mentioned in any Leopard discussions. It appears the Bridge lets a developer write Cocoa, but paraphrasing the classes and commands in an application’s Scripting Dictionary. If so, this will be quite tedious for developers to implement. In practice, they’ll have to write an AppleScript to determine how an application’s Scripting Dictionary works. Then developers will have to translate the AppleScript into the equivalent Cocoa code. It would have been nice if Apple could have provided practical information how developers will work with the Scripting Bridge. As well, the example given only demos the Scripting Bridge getting data from an application. But does the Scripting Bridge work both ways? Will it also send data to another application, and does it provide for the receiving application transforming the data and returning the result to your application? If the Scripting Bridge is two-way then the benefits gained by using it will far outweigh the mucking around us developers have to do with NSAppleScript and friends.

The article also mentions Core Animation and 64/32-bit hardware support, but these are treated too briefly to get an idea of how they might be used in an application.

Leopard Developer Tools Overview

Apple have published the second article in their Leopard Technology Series for Developers. This one’s about the updated dev tools in 10.5.

The Xcode Editor improvements will be nice, especially highlighting compile-time errors and warnings. Fixing these is a pain in 10.4. You have to click the red, round, error icon in the bottom right of the Xcode window to jump to the first error. With Xcode 3 a bubble appears at the line where the error occurred. This doesn’t appear to be much of an improvement. It appears you still have to scroll thru your file to find the bubble. I’d much rather be presented with a list of errors in a separate HUD window so that I could pick an error and jump immediately to it and then inspect the info in the bubble. Don’t get me wrong, the bubble feature is a definite improvement because it provides info about, and an easy way to correct errors.

Code folding has been added to the Xcode Editor. This feature needs a shortcut key if it is to be useful. (I loathe dragging a mouse about on screen.) I wonder if the folding feature is now available to all Cocoa apps via NSTextView or some other API?

The new Research Assistant in Xcode is an excellent addition. In 10.4 you have to swap between the Documentation window and your code window. But in 10.5 you’ll be able to view the Research Assistant window right beside your code window.

The article also discusses Objective-C’s automatic garbage collection feature, the new for iterator, and a simpler way to create accessor methods, similar to Ruby.

Interface Builder gets an update in 10.5 too. Unfortunately the screen shots are very small and I could barely see details of the new Core Animation properties in the Inspector window and the new UI palette.

Lastly, the article discusses ‘the poor man’s source code control’ feature – Project Snapshots. I’m really looking forward to this so I can go to town on my source code and being able to simply revert my changes without having to muck around with a SCM system.

AeroXperience on Mac OS X 10.5 Leopard

AeroXperience (a forum for Windows Vista developers) gives us more intel on Mac OS X 10.5 (aka Leopard):

  • Disk recovery tools now built into Disk Utility,
  • an improved Firewall,
  • dictionary lookups and mathematical calculations from Spotlight,
  • new developer contols (Mail-like buttons)

Objective C 2.0

Nice article from Informit.com explaining the Objective-C changes coming in Mac OS X 10.5.

iPhoto 7 wishlist

I’ve just started using Flickr and have found iPhoto 6 lacking in a few respects. Here’s a few things I’d like to see in iPhoto 7:

  • Better keyword implementation
  • Better photo sorting
  • API for plugins

Better keyword implementation
The current implementation of keywords is tedious. New keywords can only be added from iPhotos preferences. And a single keyword can only be added to a photo by dragging it onto a keyword button. As well, it appears that keywords cannot be added using AppleScript because the iPhoto AppleScript dictionary does not allow for keywords to be easily manipulated.

iPhoto 7 should allow new keywords to be added via the main iPhoto interface. In addition, new keywords should be able to be imported into iPhoto 7, eg, a set of keywords describing your geographical location, a group of keywords related to a family that can be shared with other family members, or a group of keywords that relate to a business. Also, keywords should be applied by selecting one or more photos and then choosing one or more keywords.

I believe (though this belief may be wrong) that iPhoto 6 keywords aren’t stored with the photo. That is, in the EXIF metadata for the photo. This means the keywords are lost when you share them. iPhoto 7 should remedy this by storing all keywords internally, but saving specific keywords into the EXIF metadata for individual photos. Also, keywords should be able to be put in a named set, and added to a photo by applying this set to the photo.

To be fair, I don’t know of any other program that does keywords right. Photoshop Elements is tedious to use in this respect too. It’s possible that Aperture and Adobe’s new photo lightroom thingy do keywords right, but they’re professional programs. And if they do, then that’s beside the point – consumers should get ease-of-use with iPhoto too.

Better photo sorting
iPhoto lets you view your photos by title, keyword, film roll and rating. iPhoto also sorts by photos by title, keyword, film roll, rating and date. Almost identical aren’t they? Confused? So am I. My expectation is that I can choose one of these views, and then have the photos within the view sorted in a particular way. But that’s not how it works. Instead, sorting overrides the chosen view. For example, I love the Film Rolls view. But when I choose to sort by keyword or date, the named Film Rolls are removed and all photos are ordered by the chosen sort method. So it seems a View is just a named sort. This isn’t very useable. Apple either need to combine Views and Sorts so that they’re consistent, or make them work as expected.

API for third-party plugins
iPhoto works well with .Mac. But many people don’t use .Mac, and based on the blogosphere it appears the number of .Mac users is decreasing. While iPhoto has an API that allows developers to write plugins, this API is unsupported and not documented. Apple need to publish an API for iPhoto plugins so that services such as Flickr and MySpace can be directly supported. If Apple don’t do this then they will marginalise iPhoto, making it relevant only to a dwindling number of .Mac users, and push users of fast growing social sites like Flickr and MySpace into using other tools.

I’d appreciate your comments about the issues I’ve raised above. Please correct me if I’m confused about how to use iPhoto 6, or add your own wish list of features.

Thanks.

Follow-up: WWDC 2006 and Cocoa

In my previous post, I wished for changes to Cocoa at WWDC 2006. Specifically, garbage collection, Server-based Core Data storage, and expanded ‘Kits’.

So what do we know about Cocoa after WWDC 2006?

  1. Objective-C 2.0 includes Garbage collection, auto getters/setters, a foreach loop construct, and probably other improvements
  2. CoreAnimation
  3. Apparently a Cocoa-based QuickTimeKit, and the deprecation of Carbon based QT (???)
  4. Time Machine API
  5. A faster Xcode 3 which supports refactoring
  6. Interface Builder which includes a palette of resolution independent controls
  7. A new Image Kit, probably supporting resolution independence with other improvements
  8. 64-bit support from the Darwin layer all the way thru to Cocoa and Carbon
  9. An iCal framework
  10. NSGridView class
  11. NSTextView improvements ‘including a system-wide grammar checking facility, smart quote support, automatic link detection and support for copying and pasting multiple selections’
  12. Improvements to the iChat framework
  13. A new RSS/Atom framework

Check Apple’s objc-lang mailing list for more info about the Objective-C 2.0 changes, Apple’s Leopard web site for a basic overview, and the AeroExperience web site.