Seth Godin's iPhone App Ideas
The Google Maps app on the iPhone has traffic data already--what's missing is that I don't think it takes that into account when selecting a route, or updates it if conditions change. If the traffic data is available with an API (like most google data), then this might be easier than even Seth thinks (no server side) -- of course, no lock-in either.Have the iPhone use the gps data... upload where I was a minute ago and where I am now. Figure out my speed and route. Use the data to tell other RadaR users which route is best. It's worth $20 a month if you live in a place with traffic jams. It's a natural monopoly--once someone figures it out, why wouldn't everyone want to use the market leader?
The second idea needs some kind of server-side dialier because Apple doesn't let apps run in the background:
Here's an easier one that you could probably sell as well. I type in a phone number and enter a time. Record a message and press go. I can cue up a bunch of messages that are based on time. I can have groups get the message I record, at the time I want them to get it.
Interesting iPhone App Pricing Articles
This other article from Andy is also good.The fix for pricing too low is really simple: raise your prices. Most $0.99 apps should become $9.99, $4.99 apps should become $14.99, and so on. With a $9.99 app, you’d make $7 per copy and at 16 copies per day, you’d make about $40,000/year. That’s not a great income, but that could potentially support one iPhone product being developed in some Iowan’s wheat field.
John Gruber made an interesting point when he linked to Andy (software with higher prices needs demos and refunds)
Tap, Tap, Tap has had a couple of AppStore hits, so what they have to say is also very interesting.
iPhone apps are typically much smaller and more focused than desktop apps and as such, should be priced accordingly. In addition, you need to take into account the much larger market that you’re dealing with here… Apple is selling well over 10,000 iPhones per day and these are all potential new customers, plus all the existing iPhone owners and iPod touch sales.
Unit testing on the iPhone
One quirk -- it instructs you to add a build step that runs the unit-tests during build time and shows the failures as compiler errors that you can then use XCode to track down. That's nice, but I have found that you don't really have enough of an environment to successfully run every kind of test -- they run fine if you run them in the simulator. The main problem I have is with setting up my database in my Documents folder -- I get errors at build-time that work just fine at run-time.
Get iPhone programming tips in your inbox with my Beginner iPhone Programming Tips newsletter.
How I use Habits

Generally, I use Habits to help with Sharpen the Saw type of tasks -- things I want to make sure I do every once in a while, but not necessarily at a specific time. Also, unlike a recurring event in a calendar, I can record how well I do with them (if I do them late, early, or skip them).
Debugging memory based crashes on iPhone
In Xcode, it's actually really easy to get information about how you might be managing memory incorrectly.[...] crash as early as possible. It's no fun to figure out a crash bug once the culprit function has already returned. You really want the root cause somewhere on the call stack when it's detected.
Tip 1: Set Deallocated objects to Zombies
Go to Project->Edit Active Executable, go to the Arguments tab and in the environment variables section, add
NSAutoreleaseFreedObjectCheckEnabled
NSZombieEnabled
NSDebugEnabled
And set each to YES. You can leave them there unchecked, but if you check them, then your application will now do some extra checking on autorelease and release and give you a good stack trace when you have done it wrong. A common problem is to think you need to call release when the object is already set to autorelease (see yesterday's post on what the rules are for that).
Tip 2: Enable Guard Malloc
If you think you are having an issue where you go out of bounds of a heap allocated memory block, then in the Run menu, you can check "Enable Guard Malloc". This will tell you if you overrun your bounds. It's not going to be as handy as a Page Heap style check (where each heap allocation gets its own page and therefore crashes at the point of the mistake), but it's better than nothing.
After doing this, you get more capabilities in the debugger. Read this article to see how to use them.
UPDATE: I wrote a much more detailed version of this that focuses on Understanding EXC_BAD_ACCESS.
Get iPhone programming tips in your inbox with my Beginner iPhone Programming Tips newsletter.
Managing memory in iPhone applications
When I first started Habits, I didn't really read through the entire memory management API (there were so many other APIs to read) because I have been using reference counting for a long time (old COM programmer) and the awesome leak detector included in XCode was a good enough guide to what I was doing wrong.
However, the rules are really simple, and now that I know them, I never run into memory management issues:
- Declare all of your object pointer @properties as retain unless you have a really good reason not to. Then the setter that is generated will automatically call retain when you assign. When you reassign, it knows to call release on the old value.
- In your dealloc, assign all of your @properties to nil. This has the effect of calling release on the current values if they are not already nil.
- alloc returns an object with a reference count of 1 -- so you have to balance with a release.
- If you alloc, then you should try to release in that same function. To retain the value, assign it to something that retains. Exceptions are if you are a factory function that is returning a value up to be retained by the caller.
- Obviously, each retain call needs a release.
- Built-in convenience functions return objects that are autoreleased. That means you shouldn't call release on them -- the framework will call release at some point (they are registered in an autorelease pool that that is serviced when you return back to the framework). If you created the object without an alloc/init pair, you don't need to call release unless the docs say you do (but they probably don't)
- Check all of your work with the leak detector. Also, if you crash, you're probably doing it wrong -- I will have more to say on that soon.
I highly recommend that you read Very Simple Rules for Memory Management in Cocoa on stepwise.com. Keep in mind that the suggestions for building proper setters is handled automatically if you declare your @properties correctly.
Get iPhone programming tips in your inbox with my Beginner iPhone Programming Tips newsletter.
iPhone Development Tips
- Go enroll in the iPhone developer program before you start. Yeah, I know -- it's 99 bucks. But if you have an idea and a reasonable chance of doing it, just take the plunge. I joined after I finished, and that caused a lot of delays -- I could have been completing the other necessary steps in parallel.
- As soon as you're in, go get your application contracts going. If you want to make paid applications, you have to give Apple your tax and bank information. Again, it takes some time to get approved, so start early.
- If you don't know Objective-C -- don't worry, that's the easy part. The primer on the iPhone developer site should be good enough if you know C/C++.
- For Cocoa Touch, I recommend Erica Sadun's iPhone Developer's Cookbook. The chapter on coverflow is worth the price of the book, but everything else is there too (navigation, touch, location, contacts, etc)
- I also highly recommend iCodeBlog. Once you have some basic knowledge of the framework, check out the to-do application tutorial.
Update: just found this great flowchart of the right order to do things
Get iPhone programming tips in your inbox with my Beginner iPhone Programming Tips newsletter.


