Martin Ström
my-domain.se

Haxxor night

I’m building a pretty cool little project with Ruben right now. More info soon here!


CopyPasteCharacter iPhone Application

A couple of weeks ago our official iPhone application for CopyPasteCharacter.com finally became available on the App Store. The project itself isn’t too complicated but was my first “real” Cocoa and iPhone app so it took some time to get everything together and learn how to do things.

The application basically lets you find and easily copy symbols, characters and letters which otherwise can be hard to find on a regular keyboard. On the iPhone, many of these characters aren’t available at all by just using the system keyboards. Just touch one or many symbols to automatically copy them into your clipboard and paste them into any application (SMS, Facebook, Twitter, Mail etc).

I was happy to see that the app was approved by Apple only two working days after I submitted it. I had, however, waited about 2 months to hear from Apple on how we should solve a problem with my iTunes account.

Hint: You can’t use the same Apple account to upload/sell music in the iTunes Store as upload upload applications to AppStore. Create a new account before buying the iPhone developer program to stay out of trouble.

Please check out the product page with a video walk through or go directly to the AppStore.


AutoPair functionality using Cocoa KeyBindings

I’ve been using the application “AutoPairs” since it was mentioned on 43folders some time ago. Yesterday (via the Macromates TextMate blog) I found an article on the Cocoa Text System and realised I could recreate AutoPairs’ functionality by just using native Cococa Keybindings found in OSX.

Add these lines to your ~/Library/KeyBindings/DefaultKeyBinding.dict (create the file if it isn’t already there) and the commands will be available in every application started afterwords.

/* Recreate Auto pairs functionality */
"\\\"" = ( "insertText:", "\"\"", "moveBackward:" );
"("    = ( "insertText:", "()", "moveBackward:" );
"~("   = ( "insertText:", "{}", "moveBackward:" );
"~8"   = ( "insertText:", "[]", "moveBackward:" );
"<"    = ( "insertText:", "<>", "moveBackward:" );

When you type e.g ⇧2 for a double quote (as in swedish keyboard layout), it’ll automatically insert the ending quote as well and place the cursor between them. This will also work for “([{<”. Remember the shortcuts are for a swedish keymap so you might want to change that.

A real time saver when writing outside an editor without this functionality built-in (like TextMate).

Update 2006-08-07 Simplfied the commands based on Jacob Rus’ comment.

CSS is in progress