Alex headshot

AlBlue’s Blog

Macs, Modularity and More

NSConference 2010 Day 3

Conference 2010 Objectivec Nsconf Mac Iphone

Today is the final day of the NSConference. Whereas the first and second days were Mac-focussed, the third day is slanted towards iPhone development. Having said that, there was a lot of overlap of interesting topics; OpenGL is supported on the Mac, and CoreAnimation featured in both parts. The winning position was being able to come to the full three days. Perhaps next year, rather than disjoint days, there will be a union of two-day conferences which you can attend as a three-day conference.

The day kicked off with Mike Lee (@bmf) on “Meet the User”. The number one expert user of the app is you; however, that’s the one person you (probably) shouldn’t be developing for. Instead, you should be designing for the common case and focussing on making your app suck less. The analogy was of doors that (by law) open outwards in case of fire in the US; however, in Europe, doors almost always open inwards (at least, for non-commercial properties). Those countries with sidewalks (and pedestrians using them…) would be more often impacted by doors opening outwards, potentially into oncoming perambulators, than fire occurring. He also advised “Make sure you know who you’re talking to before mouthing off” since it never helps to insult either your existing customers or your potential new users. Humans don’t always make sense (the example of the Fahrenheit vs Celsius scale came up as something that doesn’t make sense, but is difficult to re-educate users - the same could be argued about A4 vs Legal paper sizes). He lastly concluded how science isn’t going to buy your app; people are, so design it for people and not for scientific rationale. He then highlighted the idiocy of the tea machine buttons with the + and - apparently on the wrong buttons.

Jeff LaMarche (@jeff_lamarche) then gave his first talk of the afternoon based on his series of blog posts on OpenGL ES. As a cut-down version of OpenGL, it’s compatible on the Mac as well; but floats are used instead of doubles, and some types of drawing operations aren’t available (e.g. you have to draw with Triangles, but not Rectangles). The key thing to remember is that there is no Direct mode for OpenGL ES (in other words, you buffer up your changes and then submit them rather than doing them in-place). In addition, the ‘newer’ iPhones/iPod Touches (3Gs, 32/64G touch use ARM7) support OpenGL ES 2.0, whereas all devices support OpenGL ES 1.1 – apparently, OpenGL ES 1.1 is emulated on an OpenGL ES 2.0 device using a shader for the 1.1 calls. The advice is to focus on learning OpenGL ES 1.1 at first, and leave OpenGL ES 2.0 until you have the basics with 1.1 sorted. You should even consider if you need OpenGL at all - using CoreAnimation or CoreGraphics might be enough in some cases (where performance is not an issue, or where portability to non-iPhone platforms is not needed). Jeff shared some performance tips; specifically, trying to avoid object allocation/usage for many items, preferring structs to represent vertices and colours, as well as static in-lining of functions for performance. His blog has a number of templates, which hopefully will be uploaded to GitHub (if so, this post will be updated/commented). He also highlighted an issue with using Thumb on iPhone ARM6 models and floating point; if compiling OpenGL apps for ARM6 models, then disabling thumb is recommended; conversely, ARM7 models have no issue with thumb and floating points. He gave a hint to enable conditional build compilation based on architecture to automatically enable this.

Marcus Zarra (@mzarra) gave a talk on Core Data synchronisation, and specifically, the point of ZSync. This uses CoreData as a storage mechanism, coupled with locality services using Bonjour and BLIP (BEEP like protocol) to perform synchronisation. The first phase is ready, but only supports device-to-mac synchronisation. Future iterations will support mac-to-mac and mac-to-cloud.

Over lunch, a number of ‘mini talks’ happened. (They have happened on previous days, but I’ve not been able to catch up with them). @aral gave a talk on ‘avit, a barcode scanner and hook to Safari Books Online. His presentation was on attention to detail; he highlighted the parallax scrolling on Silverback as an example of something which is sufficiently hidden but enjoyable once found, and also as a segue into detail-oriented applications as a means of self-marketing. @danielctull announced SpringBack as a mechanism to record the user’s current position in an applciation (and interestingly, the only person in the conference to use BitBucket/Hg over GitHub/Git).

After lunch, Drew McCormack (@drewmccoramck) talked about the physics of Sumos and talked about the CoreAnimation features under the covers. The demonstrations were great; several stages of the application in development were shown, each stage adding more to the experience. There were some brief code example snippets, but mostly at a font that wasn’t easy to read. Some important takeaways; if you are chaining multiple animations, a cheap way of achieving it is to use delays to stagger several things in one go; however, you can only animate a single property once in a set of chained animations (latter assignments wipe out earlier assignments). If you need to do e.g. multiple transformations, then you need to hook in animationDidStop events to chain the next animation in sequence.

Lastly, Jeff LaMarche (@jeff_lamarche) concluded the day with a discussion of GameKit. Sadly, this is (currently) only available on iPhones, and although the API has been designed to support over-the-WAN networking, at the moment the only reliable mechanism is using Bonjour for local networking. Most of the data is fed back via delegate callbacks; a GKSession is created (in peer, client or server modes) and then data is punted over reliable or unreliable connections. Data will then appear at the other end automatically. If you want to support online play, then you have to do the work yourself to get data back and forward using lower-level networking primitives.

That concluded the 3-day marathon NSConference. Was it worth it? Undoubtably yes. There was a lot of discussions over tea points, in the corridors, as thrown-away comments in presentations, not to mention all the people commenting on the #nsconf twitter hashtag. There’s another run of NSConference in the United States between 21st and 24th February – if you’re over that side of the pond, I can highly recommend signing up for that event. Here’s to NSConference 2011!