All posts for the month December, 2010

Quartz composer plugin errors

-[QCPlugInPatch _addOutputPortWithClass:forKey:attributes:]: Inconsistent state

I came across this error recently when trying to write a custom patch for QC.  If you get this error more than likely you are trying to use a consumer patch with outputs.  You can not have outputs with a consumer patch.  Change kQCPlugInExecutionModeConsumer to kQCPlugInExecutionModeProcessor.

Split NSString into an array of objects each containing one line.

For example, say we have the following tab delimited string

AH162h 0 1926 2516 1

AH162h 1 1926 0×0012 3412

3456 7402 0×342 0×548

and we want to have each line be an NSString object in an NSArray

Your ads will be inserted here by

Easy AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot OR
Suppress Placement Boxes.

In OS X 10.4 and below

NSArray *lines = [stringOfLines componentsSeparatedByString:@\n]

Each NSString object in lines could further be broken down into Tab delimited NSString objects

NSArray *tabStrings = [lineString componentsSeparatedByString:@\t]

In OS X 10.5 and above

NSArray *lines = [string componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];

About a year or ago I purchased a D-Link DGS-1024D 24-Port Gigabit Switch to replace a malfunctioning Netgear 16 port gigabit switch. I really did not intend to purchase a 24 port switch as it is probably overkill for a home network. However, almost all my ports are connected to something. Nowadays, it is not just desktop computers needing a connection. It is everything from TV’s, wireless bridges, home stereo, set top boxes, and dvd players to gaming devices. I had not used D-Link products lately due to some less than desirable results from some of their products in the past but was surprised at the quality of this switch. It runs cool and powers down ports which do not have an active link. Best of all it has the ability to diagnose a faulty ethernet cable and let you know through the LED lights. This fast and responsive switch has made a hugh difference in the reliability of my network and clarity of my VoIP connection. This is probably one of the best switches I have owned.


I sat down this weekend to begin writing a metadata application for itunes .m4v movies only to discover my orginal plan had to be modified .  I had been wanting to do this for some time now since I got the new AppleTV 2010.  The AppleTV really looks nice when the metadata for each file is complete.  Having cover art show up on coverflow really gives the experience a nice comfortable feel.  This sort of application exist already I know, but I had a different feature set in mind.

So with my idea in hand and some research I had done in the days preceding, I started to get to work.  I thought that I would use the amazon database for the metadata and the Quicktime API to do the writing to file.  Should not really be a problem since Quicktime does have an API for this sort of stuff.  I started as I usually do, just getting a one piece of metadata written to file then making progress from there.  After several hours of trying, and some google research I learned that the Quicktime API only supports the .mov container format not the newer iTunes formats.  Why Apple why????  Since itunes does support editing of metadata for all of it’s formats the API must exist somewhere -privately I suppose. I will try again, this time using Atomic parsley.

Additonal notes:

Mp4v2 instead of Atomic Parsley.

Mp4chaps to set chapter names