It was just your typical InterfaceBuilder 3 window…
AcornImage
February 19th, 2008 · 7 Comments · Default
Tags:Acorn·Cocoa·Flying Meat·gus mueller has a posse·Source Code
R.I.P Toxic Progress Indicator
October 30th, 2007 · 2 Comments · Default
Thanks to Matt Gemmell for pointing out that Apple has finally provided a pie chart style NSProgressIndicator for the circular/determinate modes. This style is new to Leopard. This means my Toxic Progress Indicator class can be retired, at least for 10.5+ only applications. Leopard has really helped to retire a lot of my code (for [...]
Tags:Cocoa·Default·Source Code·toxic progress indicator
SpaceNavigator controlled Lego Mindstorms NXT
September 26th, 2007 · 2 Comments · Default
It’s my second year of coaching a First Lego League team. The experience has been fantastic, I’m teaching 4th and 5th grade children about robots and computers, and teaching them to build and program their own robots. This year the kids are going to be learning how to use the new Lego Mindstorms NXT robot; [...]
Tags:Cocoa·Lego·Links·Mindstorms·NXT·Source Code·SpaceNavigator
The Intersection of Cool and Awesome
September 25th, 2007 · 12 Comments · Default
3Dconnexion (a division of Logitech) produces the coolest named device ever: The 3Dconnexion SpaceNavigator . This is a 3D input device with 6 degrees of freedom, meaning you can move and rotate it through the X, Y and Z planes. I bought it originally on a whim (hey only 50 bucks!) for use with Google Sketchup [...]
Tags:3Dconnexion·Acorn·Cocoa·Flying Meat·Source Code·SpaceNavigator
‘Discrete’ NSLevelIndicatorCell too slow
June 24th, 2006 · 6 Comments · Default
I recently needed to embed the ‘Discrete’ variant of the NSLevelIndicatorCell into an NSTableView. The discrete cell looks like this:
Unfortunately adding the cell caused drawing of the table’s window to slow to crawl. The spinning beachball of death would often appear when I was merely resizing the window. After some quick experimented I narrowed [...]
Tags:Cocoa·Default·NSLevelIndicatorCell·Shark·Source Code
Grab that Invocation
June 23rd, 2006 · 3 Comments · Default
CInvocationGrabber is a Cocoa class to help with creating NSInvocation objects.
NSInvocation objects are Cocoa’s equivalent of “functors” and are extremely handy. But unfortunately creating them is often a pain. For example, take the following code showing how to create a simple NSInvocation:
NSInvocation *theInvocation = [NSInvocation invocationWithMethodSignature:[theString methodSignatureForSelector:@selector(insertString:atIndex:)]]; [theInvocation setSelector:@selector(insertString:atIndex:)]; [theInvocation setTarget:theString]; NSString *theFirstArgument = "Hello World"; [theInvocation setArgument:&theFirstArgument atIndex:2]; unsigned [...]
Tags:Cocoa·NSInvocation·Source
Toxic Progress Indicator Updated
June 21st, 2006 · No Comments · Default
Thanks to Daniel Jalkut for submitting a patch to Toxic Progress Indicator. The patches fixes a couple of silly bugs with setMinValue/setMaxValue and also makes the code a little bit more generic. I’ve updated subversion with the patch, which is recommended for all uses of ToxicProgressIndicator (both of you).
Tags:bork·Cocoa·ToxicProgressIndicator
Cocoa: Fetching all attachments from an NSAttributedString
November 27th, 2003 · No Comments · Default
This code snippet is a category of NSAttributedString that shows how to fetch all attachments from the string.
Header:
@interface NSAttributedString (NSAttributedString_MoreExtensions)
/** * @method allAttachments * @abstract Fetchs all attachments from an NSAttributedString. * @discussion This method searchs for NSAttachmentAttributeName attributes within the string instead of searching for NSAttachmentCharacter characters. */ - (NSArray *)allAttachments;
@end
Source:
@implementation [...]