Archive for the ‘Mac’ Category

Development on a Mac: Textmate + bundles

Thursday, July 30th, 2009

With the start of my new job I finally got a Mac to use at work. I’ve been using one at home for going on two years, so it’s nice to finally use an OS I like at work. With this comes the need to use a good editor for development.

At home I’ve used an array of IDEs and editors, never finding one I’ve really liked besides the old standard of VIM. I’ve used VIM for much of my development for years, so I’m pretty proficient. At the same time, it just doesn’t fit in well with OS X. I’ve used Textmate a bit before, but never really for long or on a large project. That was about to change.

Most of the developers at the company use Eclipse. I personally find it slow and buggy — and so do some of the other developers. I decided to download Textmate and give it a good, solid roll. I quickly got up to speed on the shortcuts and was able to get things done without cursing at my editor constantly. There were, though, shortcomings from the setup the other developers had come up with over time for Eclipse. Myself and another new developer put together a nice array of additional bundles to Textmate which made it complete for us to get our work done, at Mac speed.

  • Synchronize remote directory [rsync+ssh]
    • Forget trying to keep track of files you’ve edited to upload or using a separate sftp app for your project. This bundle allows you to set up a remote location to push files changes and full project synchronization to. It uses rsync and ssh so you’re looking at needing a remote unix machine with both set up and functional. Also, it uses SSH keys since I don’t believe it has a way to request a ssh password.
  • TM-Ctags (I’ve forked a fork and upgraded it a bit)
    • This will enable you to search for class, function, and other definitions in your project. When you update from source control or add code you need to update the index. Once that’s done you can search based on current text under the cursor, arbitrary search, or even code completion based on the indexed code.
  • Ack in Project
    • The built in find in project in Textmate is slow. This bundle uses ack to search much faster and also display results in a more reasonable fashion. It’s not perfect, but it is an improvement. I have some thoughts on upgrades I might make in the coming weeks.

That’s the short list for the moment. We’re finding new bundles to add all the time to make things better. Also, we’ve got a list of features we’d like to have and I’m doing what I can do find / upgrade / create bundles and plugins which fit our needs. Over time I’ll update this list with new additions.

MailWrangler inquiries and update

Monday, March 9th, 2009

So lately I’ve been getting contacted a lot about MailWrangler. I have no idea why all of a sudden there’s renewed interest from users and journalists. I haven’t had time to respond to most people, sadly, but I’ll address some things here for everyone.

First off, chances are good I’ll never release MailWrangler. Originally the app was supposed to be my little entrance into iPhone development. I needed something simple to get acquainted with design, development, and distribution of iPhone apps. It was basically my “Hello, World” app. Of course, as the story goes, Apple rejected my app after taking way too long to review. By this point I’m already getting ready to head back to school where my time was only going to get harder to put into an app.

I’m not really mad at Apple, nor do I want to really make this a big deal. Its their App Store and they can make any rules they want. We knew the iPhone was a pretty closed system when we bought them and developers knew the App Store was going to be a pretty controlled place. We can’t say we didn’t see this coming; it’s Apple.

So where does that leave me? I don’t have much motivation to update MailWrangler to the latest SDK version (right now it compiles but won’t run… something changed) so I can’t even resubmit it. The app was just a little thing I threw together in a weekend, nothing big or special. Although I think it would be useful to have, even I don’t need it more than once every so often — the built-in mail app works well enough for my needs. Also, because of my issues with the App Store, it’s hard to put in effort on something that could just be rejected again. There’s plenty of stories out there and more all the time of people continuing to be rejected or ignored by Apple’s review process. It just isn’t worth my time to keep dealing with it.

Short story? I probably won’t be getting around to doing anything with MailWrangler again for a while. While I bet there’s a good chance I could get it approved eventually, it just isn’t worth my time right now (I’d rather spend it finishing out school so I can graduate in May, and enjoying those last months of college). And although I could release it via Cydia or other similar system — there’s a significantly smaller audience and I would still need to update the app to even work. Then there’s support and maintenance. Again, for me right now it isn’t worth it.

I think I’ll stick to web applications.

LifeSync, Finally

Wednesday, June 25th, 2008

After a lot of reflection while looking at the ocean I decided to release LifeSync for free starting today. I realized much of the reason it wasn’t out yet was the need for a “perfect” 1.0 release version and setting up all the licensing and billing stuff. It is simply too much for only having a few hours here and there to do work on it. Releasing it free means a) it’s not perfect and since you’re not paying that’s a little bit more acceptable, and b) I’ll have more time to fix issues rather than deal with licensing and billing issues.

It really comes down to the fact that I can’t take people’s money without having a really great product. I think LifeSync does the job well (I use it constantly for my own calendars) but it isn’t the best. But for a FREE product — I think it is a great value.

So spread the word, there’s a FREE OS X Google Calendar & Apple’s iCal synchronizer available. You can get your copy at http://lifesync.thetr.net. If you think it’s worth it, feel free to donate something to me via the Donate button on the LifeSync pages!

Objective-C messages, checkboxes and booleans

Thursday, January 24th, 2008

So in the past week or two I’ve started a new project using Objective-C and Cocoa for OS X. If you want a good set of frustrations, here it is. Honestly.

It is hard, I mean really hard, to break out of the C++ style programming mindset. It really is automatic that when I think I need to call “doSomething” on “magicObject” to type: magicObject.doSometing(blah).
Instead I now need to type: [magicObject doSomething:blah].
It isn’t hard or overly complex — it is simply different. It isn’t how years of C++ style programming have trained my brain. And they’re not function calls, they’re messages. You send a message to an object and hope to God it does something meaningful with it.

And then there’s booleans. For whatever reason they strayed from TRUE and FALSE and opted for YES and NO. I can agree that most of the time thinking of things in YES and NO can make more sense — but it is once again hard to break habits. Of course figuring out that it is YES/NO was a pain enough. I should really find a few more good guides before continuing (and then I’ll need the patience to actually read them…).

And finally a checkbox in a Cocoa table view component. Nothing really complex about it by itself but once you layer on the fact that the checkbox itself uses NSOnState/NSOffState constants which map to integers. But the table view gives you an id (dynamically typed) object when something changes. I was consistently crashing my app when I attempted to use this value as just an integer. Reading whatever documentation I could led me nowhere. I finally found some random items on the internet that finally led me to try:
if ([anObject intValue] == NSOnState) {
Well that works. How the hell should I know to ask the parameter anObject for intValue. Honestly — if there’s a document somewhere in the Apple Developer docs that would have hinted at that I’d like to know — that way I know what to look for next time.

Returning the value for the checkbox when the table view asks for it was equally frustrating. I figured I’d just return NSOnState/NSOffState. Haha! No. You need to return an object so I had to figure out what it wanted and how to cast it. Finally:
value = [NSNumber numberWithInt:NSOnState];
Not exactly what I figured. Creating an NSNumber object and seeding it with NSOnState.

As with any new language and technology there’s a lot of things that people used to it assume and outsiders struggle to figure out. I’m hoping to overcome the struggling soon. Until then, expect a few more posts outlining my struggles.