Archive for April, 2007

Cocoa Bindings

Wednesday, April 25th, 2007

The basic concept for the Cocoa client is to wrap up a context and associated structures in a class (ContextInterface.h) then maintain a representation of the current context external to this class, to make it easier to update the interface as the context processes sockets. This takes the form of an NSArray of NSDictionaries, one dictionary per torrent.

I’ve had it in the back of my mind to convert the GUI over to using bindings instead of delegate / datasource methods, and now that the current svn code has a rudimentary level of state display (via stdout piping to a textview), I’m busy refactoring the code to use bindings.

There’s a very useful tutorial over at CocoaDevCentral which teaches the essentials of bindings, and makes understanding the class documentation much easier.

Creating a secondary .nib

Tuesday, April 24th, 2007

It’s nuts how hard it is to find an accurate (and more importantly complete) guide to creating a secondary .nib to hold a secondary window and controller in XCode/IB.

I stumbled across the SimpleMultiWindow example in XCode’s Sample Code (/Developer/Examples/InterfaceBuilder/SimpleMultiWindow), and it contains all the pieces, as well as how to send messages and call methods between windows. Handy as a guide to work from.

GUI Progress

Sunday, April 22nd, 2007

I’ve been making fairly steady progress on the GUI client. The current svn code can now add torrents from either the GUI or a disk cache, remove them from the active context, and most importantly, upload and download them. It still has a number of rough edges, and the UI isn’t the most appealing one. However most of the behind-the-scenes code is in place.

Things still to implement before 0.0.5:

(more…)