tonyarnold.com

Jan 13

Signing a user up to your Campaign Monitor mailing list from within your app

This is the first of my ‘Giving back’ posts. The idea is that I’ll give something back to this wonderful Cocoa coding community at least once every couple of weeks. I mean, what’s the point of going indie if I can’t do what I want once in a while? :)

CBMailingListSignup example

Of all the marketing avenues I continue to investigate and read about, mailing lists seem to be something that the rest of you recommend time and again. I missed a few boats when I launched Hyperspaces - were I to do the launch over again, I’d make sure that a mailing list was in place and easy to join from my website and within my app. I’ve always admired the way the Panic apps ask you to join their mailing list the first time you start them - it’s simple and unobtrusive.

As part of my work toward future versions of Hyperspaces, I’m looking to do the same. I’m still deciding which mailing list package/provider I will use in the end, so please don’t take this as a “this is what The CocoaBots use” post, however I did meet the Campaign Monitor guys at Web Directions South 09, and their product has a nice web service API. So I put together a small example project that will sign a user up to your Campaign Monitor mailing list from directly within your app.

The code is heavily inspired by Uli’s UKCrashReporter and Wolf’s JRFeedbackProvider projects (this is like a mutant offspring of the two). I may not end up using it in my apps, but hopefully someone else finds it useful.

The GitHub project is at http://github.com/tonyarnold/CBMailingListSignup, and the code is licensed under the Creative Commons Attribution 2.5 Australia License.

Come and join the discussion.

Dec 15

Hyperspaces 1.0 and The CocoaBots

There’s more about this over at the new CocoaBots blog, but I just launched Hyperspaces 1.0. Further to that, The CocoaBots is now a full-time venture - check out the new site for more info!

I’ll put together a post about going indie soon (I promise!) but for now all I can say is that I love it!

Come and join the discussion.

Aug 23

Core Animation uses a lot of memory

Here’s something Apple should probably put on the box when they sell Core Animation to new developers: It uses a lot of RAM. Before you dive in with both feet, you need to ask whether the features you get from Core Animation will really be worth the overhead.

In Hyperspaces, if you’re running on a single monitor set-up, you’ll generally see RAM usage around the 60-100Mb mark (RSIZE). Two screens, you’re going straight beyond the 100Mb mark. I assume it grows exponentially from there, but I’ve no machines on hand that will drive more than 2 screens (Update: I assume wrong - the caching is pretty good for CGImageRefs and their ilk. It won’t grow exponentially).

On a single monitor set-up, there are two layer-backed views - one screen-size view that sits behind your desktop icons, and one smaller view that contains the switcher. If I run up Hyperspaces without either of my layer-backed views enabled, the application uses 13Mb RAM - so the core (for what it does) is quite compact. If I re-enable the layer-backed switcher window, memory usage instantly jumps to 56Mb - the switcher is usually about 500 - 600px wide, and about 100px high (with 3 spaces enabled).

I have spent months trying to bring this number down by any means possible. So far, I’ve tried:

  1. Cropping and chopping my CGImageRef objects down to only exactly what’s needed for display;
  2. Aggressively caching and uncaching CGImageRef objects (thanks go out to Sean O’Brien for helping me with that);
  3. Storing only the CGImageSourceRef for each of my images and explicitly telling those sources not to cache their CGImageRefs;
  4. Saving those cropped and chopped CGImageRef objects out to cached JPEG2000 files and then reading those files back into cached NSData objects to be decoded when needed;

There are probably other things I’ve tried that have worked to varying degrees, but those items above are the ones that made a difference. They don’t solve the problem.

If you’re writing a background application that you expect your users to have open all the time, you (unfortunately) will need to think very carefully about whether you should use Core Animation in your application. I’ve had feedback from users of Hyperspaces that they would prefer to leave the animation in - while I pitch Hyperspaces as a tool that provides context to Apple’s Spaces, I’m pretty sure a lot of the users are more into the eye candy and the softly fading desktop images :)

I’ve certainly asked for advice about this issue in a few different places, as well as done my research - and I’d be very happy to be proven wrong (please?!).

Come and join the discussion.

Tumblelog

5 Jun 08

Neil’s white whale of a blog: A seriously impressive rebuild with a focus on speed and accessibility of information. Everyone can learn something from Neil.

28 Apr 08

Scalability really does have a lot to do with arse: http://teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html

Linky Linky