echoPost: Learning Cocoa
I spent the most of the day today mucking about in Xcode trying to create a Cocoa/Objective-C program that will allow me to make posts to my website directly from the application. And if you are reading this message then it was successful.
At the moment my solution is kind of a hack — obviously it is designed for my site only, so there isn’t much use for the program commercially. But as well, I am doing most of the hard work with a PHP script. Essentially all the Cocoa part does is provide an interface (I even created icons) to compose and prepare the entry. When I click Post, the application writes out a
plist file — which for the non-Apple folk are simply XML property lists — and then runs a PHP script on that file. The PHP interprets the file and makes a HTTP POST to my website with the proper credentials. I decided not to connect directly to the remote database because even though I can do that now, when I move my site it may not be possible.
The plan is that soon the program will allow me to save drafts of articles that I am writing. Then I can call up older drafts and edit them and when I’m done — post them. I’d also like to be able to edit my posts on the site with this tool, but all things in due course. As I get more comfortable with Objective-C I will start moving more of the functionality into the Cocoa app and at some point probably implement an XML-RPC server so that I can communicate in a more standard way. At the risk of losing even more people I think I should probably stop there and continue later as the project progresses.
Mar. 7 1:56 I uploaded a screenshot of echoPost. There is a drawer on the right side that will have the drafts stored in it, but at the moment that doesn’t really do anything. Still early.