Sunday, May 15, 2005

Cocoa and Java

No, I'm not talking beverages, but rather a development API for Mac OS X.

This weekend, I got my new Macintosh Mini, and I love it. So being a developer, I had to try and make an application for it. Also, since complaining about the WYSIWYG composer, I have wanted to create a small application to take source code, and format it properly for displaying on the web. A perfect chance to learn a new programming API on my new Mac.

It took very little time to learn enough of the basics to get my application working. Apple has some great tutorials on the their developer website. I had some trouble at first. I tried to create it using Objectve-C and Cocoa, but Objective-C's syntax got in the way, so I decided to go with Java. Some may say that Java and Cocoa will only lead to trouble, but until that happens, it works for me.

I'll post more as I continue to learn. Right now, my little app simply takes the source code in a TextView, and then converts the text into a nice HTML format in another TextView. It replaces spaces with non-breaking spaces, less-than and greater-than characters with the proper ampersand versions suitable for HTML, and tab characters with four non-breaking spaces. Next on my todo list for this little app is to give it some options for how I want the code formatted.

No comments: