Matt Galloway

My home on the 'net.

A look under ARC’s hood - Episode 2

Following on from my first post about looking at how ARC works under the hood I thought I would share another little snippet that I found interesting. This time I was wondering what happened when you pulled an object out of an array and returned it from a method. Pre-ARC, you would retain the object then return it autoreleased. With ARC we can get rid of those memory management calls but it just feels wrong. So I decided to check ARC was doing the right thing.

What is it with people and free apps?

So we have just released a new version of BeerMap which is an iPhone app that I created with a couple of friends. It’s had a long life and has changed significantly in this latest update because, to be honest, it was quite confusing to use. We didn’t really have a plan for it before but now we do and we’re executing it step by step.

Since 2.2 went live we’ve seen a lot more uptake of the app with more people reviewing beers and even some of the social media integration being used in the app which is exactly what we wanted. We wanted to push the app in a more social direction rather than just reviewing beers and pubs. If you’re simply reviewing beers and pubs then you need critical mass of users before any of that data becomes usable. So opting for the more Twitter-like style of a review now being a “Taste” and having a timeline of realtime “Tastes” coming in, the idea becomes like a way to tell the world what you think about the beer you’re drinking right now. We kept the idea of pubs (or places as we call them, because it might be a pub, a bar, a beer festival, etc) but you cannot actually review a pub. This serves the purpose of making the app simpler to understand because there’s just one first class citizen and that’s the “Taste”.

But, I’m sad now. Why is it that people decide for themselves what an app should do? Why is it that people writing reviews for apps cannot be constructive? Why is it that people think that free apps should be 100% perfect straight away? Here’s a review we got a day after 2.2 came out:

[1 star] – Why hasn’t beerintheevening got an app? This is not a satisfactory substitute – it neither adequately provides user reviews of pubs nor does it review beers. FAIL.

This was coupled with a support email request which goes further to complain about the app and how they failed to read the instructions for adding a new pub (it’s really not that complicated).

We’ll see what the future holds for BeerMap. I sincerely hope that it’s good things because I think that there’s a definite use for an app like this, especially in the UK where beer can vary between parts of the country so you want a way to find a pub that’s great.

GiffGaff: Great for iPad!

I’ve heard about GiffGaff from a lot of people but it was only when I realised how good it would be for my iPad that I decided to give it a go. So I got a SIM, topped up £10 and now I can spend just 20p each day and get 20MB of data! It’s great for my iPad because I can use it whilst out and about and just pay for each day that I want mobile data, which is quite rare for me really.

So if you’ve got an iPad and want cheap data for it then go grab a GiffGaff SIM and away you go!

Review: Sensible TableView

Every iOS developer should be very familiar with the UITableView. It’s the main building block of most applications (excluding OpenGL based games, of course). So back when I started developing applications when iOS was on version 2.0, I created a tutorial for creating custom UITableViewCell objects. Since then application developers are finding more and more that they need to push the boundaries of what they can do with a simple UITableViewCell. In iOS 3.0 Apple introduced a style attribute for cells, which certainly helped with a lot of situations but there is still the tedious process of creating custom cells with anything more than the standard 1 or 2 text labels.

I usually end up hand rolling a UITableViewCell subclass, or if I only ever want 1 of that type of cell in a given view (for instance a single username and single password cell) I might use Interface Builder to create the cell and put it in the XIB for the view controller. But when you end up with 10+ projects each with a handful of custom cells, you soon go quite mad trying to remember each detail about each cell.

So I was pleasantly surprised when I was recently given the opportunity to take a look at Sensible Cocoa’s Sensible TableView (STV) project, which is a collection of Objective-C classes for easily creating custom UITableViewCells.

Sensible Cocoa

Assembly - beware local label names with “-dead_strip” option!

I came across a very strange bug whilst developing an iOS application whereby the application would seg fault and whilst stepping through the code I found it was going all over the place. This lead me to run the application through otool, and I discovered that half the code for a function was missing!

Blocks in C++ classes - very broken

I was trying to use blocks (an Apple extension to the C language) in a C++ class when I came across a very strange problem. If you try to declare a block inside a C++ class member function that declares variables inside the block, then you end up with GCC (the one that comes with the Mac/iOS SDK) throwing an error.

iPhone app sales milestone - 100,000!

Yesterday I reached the next milestone of my iPhone apps – 100,000 downloads! This is over all of my apps where approximately 80% of the downloads are my free Subnet Calc app.

This is a pretty exciting milestone for me and it has come in just under 2 years of having apps in the App Store. My goals now are to continue releasing apps and updates for my current apps (in fact just this morning I released a long overdue Subnet Calc update).

Here is a little sneak at how sales have gone for Subnet Calc over the whole time it has been in the App Store:

Subnet Calc Sales

ARM Hacking: EXC_ARM_DA_ALIGN exception

I came across a problem today that I’d seen before but couldn’t remember when. Then I stumbled across Peter Bakhirev writing up his findings at Byte Club about a problem I’d helped him with. So I thought I’d quickly write up my summary here incase it helps anyone else.