Screenflick and Real-Time Compression

I received an email from a customer asking why Screenflick does not have real-time compression like iShowU. I wrote a pretty lengthy reply explaining (in as few technical details as possible) the reasons below. For you tech-heads who read it and think “But! But! That’s not entirely true!” — I know. :-) There are a few details glazed over and statements without techy qualifications, but by and large everything here is true.

If you swear I’m completely dead wrong and believe “you could do xyz blah thingymajig and it’d be waaay faster!”, then by all means, send me an email and tell me off. :-)

Read more »

Installing MySQL 5 and mysql-ruby on Mac OS X 10.5

I hate installing open source software. It’s ridiculous. Here’s the quick and dirty on how to install MySQL 5 and mysql-ruby (not ruby-mysql) on Mac OS X 10.5 / Leopard.
Read more »

Retain/Autorelease in Cocoa Getters

Someone asked me: “Why do some getters do:

- (id)object;
{
    return _object;
}

and others do:

- (id)object;
{
    return [[_object retain] autorelease];
}

…?”

The difference comes up in a special case which can cause a crash.
Read more »

AGShelfView - Mail-esque Split view

Mail and many other programs have been using this new kind of split view for a long while now. It typically has a main content area on the right side and a long table or outline view on the left side with a strip of a handful of buttons to add a new object, perform actions on it, and whatever else. Here’s an example of it seen in Araelium Edit:

AGShelfViewInAE

Writing the code to create this kind of view is fairly trivial if you know what you’re doing, but why bother reinventing the wheel? I give you AGShelfView.

Read more »

AGSidebarView Example

This is an example of how to put together a “Sidebar” like list. Mainly it demonstrates how to make top-level group rows taller than other rows so as to add padding between the groups, while keeping the custom-drawn outline cell (the reveal triangle) properly aligned. Download the project.

AGSidebarView Screenshot

Useful Nib Category Methods

If you’re loading a nib in your code that has a File’s Owner other than NSWindowController (or a subclass), then you (hopefully!) know that you need to release every top level object in the nib. If you use + [NSBundle loadNibNamed:owner:] then you need to create outlets to each of the top level objects, and release them when File’s Owner gets released.

That works fine and dandy if you do it, but if you forget to release a newly-added top level object, or forget to add an outlet to it so that you can release, you’ll leak memory. (That’s bad.) Is there an easy solution? You bet.

Read more »

Find Mac OS X System Images and Icons

Here’s a nifty little command line script to find all system images and icons and display them in an HTML file. View the file with Safari and you’ll be able to see icns icon files as well.

sudo find /System \( -name "*.png" -or -name "*.tiff" -or -name "*.jpg" -or -name "*.mov" -or -name "*.icns" \) | sed -e ’s/\(.*\)/<img src="file:\/\/\1"><\/img><br\/><p>\1<\/p><br\/><br\/>/’ > system_graphics.html

Thanks Ed

#pragma mark for Ruby in TextMate

I (unfortunately in some ways) have to use TextMate for a bunch of Ruby code and it drives me nuts that TextMate’s Ruby bundle doesn’t have a #pragma mark equivalent, so I spent a while trying to figure out how to add one. This works.

1
2
3
4
5
        {   name = comment.line.number-sign.ruby;
            match = (?:^[ \t]+)?(#)(:\s+(.*)$\n?)?(.*$\n?)?;
            captures = { 1 = { name = punctuation.definition.comment.ruby; };
            3 = { name = meta.toc-list.pragma-mark.ruby; }; };
        },

Live Resizable Date Columns

If you pay attention to little details like I do, you’ll proabably be annoyed by date columns in table and outline views not live resizing. There are some somewhat obvious solutions but they can either be slow or the still don’t have the fluidity you’re looking for. Here’s a pretty simple solution.

Read more »

Talking to iChat

The InstantMessaging framework in 10.4 is useful for getting a list of all of your buddies and getting their email address, picture, or capabilities etc, but how can you send a file to a buddy? What about getting a list of the groups a buddy is in, or even simply creating a new chat window? The IM framework doesn’t do these things. You can do some of these through Applescript of course, but I’d rather gag on the proverbial fork.

So what can you do? Well, after poking around for a short while, I figured out (it’s not that hard) there’s a connection between iChat and another program called iChatAgent. iChat controls most everything dealing with service connections, buddies, and all of that by telling iChatAgent to do it. The iChat status menu item is separate from iChat.app and talks to iChatAgent also. This is why iChat.app doesn’t have to be open and you can still be connected to AIM or Jabber or whatnot. So how can you talk to iChatAgent directly? You do so by creating a connection to it using NSConnection.

Read more »