Archive for the 'Cocoa' Category

Development Finished on MacGDBp

Posted on 12 June 2008, in Cocoa. 1 Comment.

I have just finished all major work on MacGDBp. All the v1.0 features have been added and there are no existing issues (that I know about). I’m going to put it through a few days of dog-food testing, but expect a release sometime this weekend or very early next week.

Along with testing, all the release materials still need to be prepped. Those include the website, help/documentation information, and marketing/PR. So once those are finished, all systems are go.

See you soon!

The iPhone SDK

Posted on 8 March 2008, in Cocoa. No Comments.

Regarding Thursday’s announcement of an iPhone SDK:

I am most certainly interested in writing iPhone apps. The beautiful device tempts me. Thankfully, however, I do not have any ideas for phone apps at the moment (which means no new ideas in the pipeline). I’ll update if anything strikes me. And until that point, I won’t be shelling out the $99 for a certificate.

Scrabbalize 1.0

Posted on 22 December 2007, in Cocoa. 2 Comments.

Last weekend my friends and I discovered the Scrabulous application on Facebook. Personally, I am very bad at Scrabble, but my friends insisted that I play. The game was starting to hurt my head and I was getting frustrated, so I wrote a program to do the thinking for me. Enter Scrabbalize.

Scrabbalize is quite simple. You type in all the letters (”tiles”) for your game into the text box as one long string. Press go, and then the program will run through a dictionary, finding all the words that have some or all of your letters. It then sorts the words by length so you can see your best options.

It is written in Cocoa and it requires Mac OS X 10.5 beacuse I wanted to try garbage collection and fast enumeartion. Both of these things make my life significantly easier, so expect all future Mac OS X applications to require 10.5. Of course, the source code is available if you want to take a gander.

Scrabbalize 1.0 screen shot.

PostgreSQL Build Script

Posted on 30 December 2006, in Cocoa. 1 Comment.

I’m currently working on a Cocoa project. It requires a server-client system. The current iteration of it uses a very complicated Distributed Objects system to send query objects across the network to a single instance of SQLite… and it’s rather flaky if I do say so myself. So I have decided to change it to a PostgreSQL system.

Obviously, however, PostgreSQL is not a standard component of Mac OS X--especially not a universal binary version. So, I had to devise a way to create a packaged version.

After fiddling with build settings for hours, I have come up with a shell script to build a universal version. It is meant to be run on a PPC platform to cross-compile for i386/Intel--not vice versa (though with a bit of modification you should be able to do it).

If you’re interested, you can download it here: build-pgsql-uni.sh (4KB)

And if you’re still interested, my application works like this: the server will broadcast over Bonjour a Distributed Object connection, as well as spawning this special distribution of PostgreSQL. The client will accept this and will receive a NSUrl with the database connection URL and then the rest will be handled by BaseTen. I think this will significantly improve the performance, and it will decrease code base size because I can use Cocoa Bindings.

Setting the Default Sort in an NSTableColumn/NSTableView

Posted on 13 August 2006, in Cocoa. 1 Comment.

If things have been slow on the PHP-front, it’s because I’ve been working on a few applications for my school, these apps are written in Cocoa.

This is a quick post about having an NSTableView be sorted automatically by a certain column. I can’t find a real easy way to do this if you don’t want to custom-impliment the sorting algorithm and control the -[NSTableView indicatorImageInTableColumn:] yourself.

So, with a cleverly-placed breakpoint in -[NSTableDataSource tableView: sortDescriptorsDidChange:], I found a method that is invoked on the mouse-down event. I then used class-dump on AppKit (with a filter for NSTable*) to locate the arguments.

This is the method that is invoked when you click on a NSTableHeaderCell -[NSTableView _changeSortDescriptorsForClickOnColumn: (int)columnIndex]. So, to use this, I stuck it in -(void)awakeFromNib:

[tableView _changeSortDescriptorsForClickOnColumn: [tableView columnWithIdentifier: @"lastName"]];

And viola! This essentially mimics a click on the header cell. Hope this helps if you’ve been searching for this! Oh, and you will get a warning about NSTableView not responding to the method, but it will work :).