"Code" Category

CLAlert Class

 

If you’ve ever used NSAlert in your Cocoa application and wondered why NSInformationalAlertStyle and NSWarningAlertStyle looked exactly the same when using NSAlert, you’re not the only one.  CLAlert has been released (MIT license) that uses an information bubble for NSInformationalAlertStyle, caution icon (currently NSCriticalAlertStyle) for NSWarningAlertStyle, and a red stop sign for NSCriticalAlertStyle. Makes much more sense [...]

Parcycle: A Particle System with HTML5 canvas

 

This was a very cool find, from both a user standpoint as well as from a computer scientist standpoint.  Simply put, this particle simulator revivals Flash. Listed below are a ton of links showcasing the Particle System, HTML 5 canvas tag, and more. Parcycle | A Particle System with HTML 5 Canvas Parcycle Demo HTML [...]

NSFileManager Additions

 

Continuing with providing useful Cocoa snippets, I have posted a few NSFileManager category methods to help easily determine the file size of a single file, directory, or quickly hide a file/directory using the invisibility bit (like using /usr/bin/setfile, ie: setfile -a V somefile). 1 2 3 4 5 @interface NSFileManager (MacFanatic) – (unsigned long) sizeOfDirectory:(NSString*)dir; [...]

Add Application to Dock – Cocoa NSApplication Category

 

The need to quickly add my application to a user’s Dock arose while working on a project for a client a few months back.  I was intrigued by the code (first encounter with NSAppleScript as the big one) and took some time to sit down and refine what I had originally pieced together into something [...]

Excluding Category from WordPress RSS Feed

 

There are a few WordPress plugins available that allow you to simply exclude posts from a certain category in your RSS feed, but I ran across the code that actually does the heavy lifting and wanted to share. In your template directory, create a file (functions.php) if it doesn’t exist and place the following code [...]

Grand Central Dispatch – Source Posted on MacOSForge

 

Grand Central Dispatch, introduced in Snow Leopard, brings a C API for effectively managing concurrency in your applications. Apple has now posted the code for the user space implementation online at MacOSForge. The kernel optimizations are linked in the project page, but the API only requires a C compiler supporting Blocks, such as the LLVM [...]

Podpress and WordPress 2.5+ Bugs

 

I don’t upgrade Podpress very often because it is usually a very painful process. I’m debating just removing it all together as I haven’t published a podcast episode in 2 years. For a few releases of WordPress now, I’ve had javascript errors on the page for editing a post, so that I can’t upload/insert media, [...]

Quick Tip: Compiling for Tiger on Snow Leopard

 

Just to save someone 3-5 minutes of time, if you install the 10.4u SDK to target Tiger machines with Xcode 3.2 (Snow Leopard), you will have to change a build setting to get Xcode to compile. In the settings for your target, change the compiler option from “System Default – GCC 4.2″ to “GCC 4.0″. [...]

Cocoa – Add Application to Dock

 

Here’s a little snippet of code for placing anything (or your application) in a user’s Dock. Wrote it for a project I’m working on which prompts the user on first launch to place in Dock for them. I know many people disagree with this (as do I), but it’s what the client is paying for. [...]

Xcode 3.2 – Static Analysis

 

I have only heard rumblings on the net regarding the new static analyzer built into Xcode 3.2 that ships with Snow Leopard. However, Apple has updated their Dev Center to include documentation on several new developer tools and features with the release of Snow Leopard today. The Xcode analyzer is simply put, a way for [...]