Archive for the 'Cocoa' Category

Page 2 of 4

I was disappointed last month when after a hour or two of hacking I couldn’t get mach_override (evil, I know) to work on my new MacBook Pro even though it had been ported to intel macs. I added myself to the


group and tried everything that google could come up with, but I could only get it to succesfully override local functions, it wouldn’t override any library/system functions no-matter what i did.

Today I’ve found the solution on the ExtendAMac mailing list hosted on sourceforge: this simple post contains a small patch that seems to fix all the issues I’ve been having. There doesn’t seem to be any replies to the post on the mailing list, and the post wont come up on any google searched related to mach_override on intel macs – pretty frusterating when you don’t know about the ExtendAMac mailing list. The solution is very simple, replace this block of code:

static AsmInstructionMatch possibleInstructions[] = {
    { 0x1, {0xFF}, {0x90} },                    // nop
    { 0x1, {0xFF}, {0x55} },                    // push %esp
    { 0x2, {0xFF, 0xFF}, {0x89, 0xE5} },            // mov %esp,%ebp
    { 0x1, {0xFF}, {0x53} },                    // push %ebx
    { 0x3, {0xFF, 0xFF, 0x00}, {0x83, 0xEC, 0x00} }, // sub 0x??, %esp
    { 0x0 }

with this:

static AsmInstructionMatch possibleInstructions[] = {
    { 0x1, {0xFF}, {0x90} },    // nop
    { 0x1, {0xF8}, {0x50} },     // push %eax | %ebx | %ecx | %edx | %ebp | %esp | %esi | %edi
    { 0x2, {0xFF, 0xFF}, {0x89, 0xE5} },        // mov %esp,%ebp
    { 0x3, {0xFF, 0xFF, 0x00}, {0x83, 0xEC, 0x00} }, // sub 0x??, %esp
    { 0x0 }

Hopefully this helps someone who was banging their head against the wall trying to figure this out like I was!

Average Rating: 4.9 out of 5 based on 187 user reviews.

It confounds me as to why Apple will provide an easy way to get a reference a standard system sound (via -soundNamed:) but doesn’t provide any easy way to get a list of available system sounds. Well, as you might of guessed, I’ve created a NSSound category that adds this functionality. The code is adapted from this cocoa-dev post. You can download the source files (BSD license) here.

On a side note I’ve updated the source code page. The underlying code is now alot cleaner (and renders correctly on IE!) and it uses some of those fancy AJAX transitions.

Average Rating: 4.9 out of 5 based on 270 user reviews.

I’ve finally gotten around to getting Color Blender 1.2 out the door. There’s not alot of changes (hardly any at all), most of the changes are to the codebase and project structure.

  • Changed rgb copy string to be “r, g, b”
  • Compiled & tested as UB
  • Some code cleanup


Average Rating: 4.5 out of 5 based on 258 user reviews.

Such a simple piece of functionality, you would assume it would be trivial to implement. As you might have guessed – it’s not. There has been a few hack-ishy ways outlined here but none are complete and easy to integrate into your app.

I’ve created MABLoginItems, an easy way to add the ‘add to startup items’ functionality into your application. With one line of code you can add your application to the users login items (you can also remove from login items, and check if the application already exists in the login items). MABLoginItems is released under a BSD license, you can download it here.

Average Rating: 4.8 out of 5 based on 174 user reviews.

Bringing use to my cocoa icons is DKActionButton, an easy to use class that allows you to create ‘action buttons’ as found in many cocoa apps today. DKActionButton is used in App Stop, along with another unreleased application (hence the DK prefix). Heres what it looks like in action:
Cocoa Action Buttons made easy with DKActionButton
DKActionButton is pretty easy to use and simply takes a couple minutes worth of work in interface builder and a couple lines of code. You can download DKActionButton along with a sample application here. DKActionButton licensed under the BSD, so you can use it in commercial/shareware apps.

Average Rating: 4.5 out of 5 based on 266 user reviews.

After many months of development I’m happy to announce that App Stop V2.0 is almost done and will be released, by the latest, in two weeks.

The main changes in App Stop V2 are under the hood. Almost the entire code base has been rewritten. This fixes the two major issues with App Stop 1.1: performance, and Intel incompatibility. App Stop is 2-5x faster and now runs on Intel based Macs. Of course App Stop V2 will also come with a slew of enhancements, UI tweaks, and bug fixes; but the main focus for this release was performance and Intel compatibility.

Keep checking the blog for updates, but in the meantime here is the new ‘table view’ (now called the Application Manager) in App Stop V2.

App Stop V2 Application Manager

Average Rating: 4.7 out of 5 based on 199 user reviews.