Today I came across an interesting blog post from Jeff Lamarche, one of the authors of Beginning iPhone Development: Exploring the iPhone SDK. In the post he shows you how to create an alert box that accepts user input. Some of the underlying concepts may be a bit advanced for some people but you may be able to use his code in some of your projects.
Here is Jeff’s post:
http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html
About MattjDrake
Interesting Reusable Code You Will Like
Customize Grouped Table View Cells
Today, I can across this article while looking at my iPhoneFlow updates on Twitter. Essentially, they show you how to set custom colors in the table cells of a table view. While using a standard table view is relatively easy, trying to set properties for the grouped table view (the one with the rounded corners) is not as easy. This article does a good job of showing a workaround if you want to customize the background color of your table cells:
http://pessoal.org/blog/2009/02/25/customizing-the-background-border-colors-of-a-uitableview/
Here Are Some Ways to Make Money on the iPhone
Some of you may be interested in iPhone development simply as a hobby or a project to share with friends. However, I get a lot of interest in how to create a business or career doing iPhone development.
Why?
Well, being an independent developer working on a platform you love to work on has a huge appeal to many people. But, doing this and potentially quitting your job to do it full time is something that requires more than savvy programming skills. One thing to think about is what your business model is going to be.
Business model means how are you going to make money? Money is the lifeblood of a business and you will need to make sure you have a plan to ensure cash flow so that you can give your products the attention then deserve. So, to spur you on to thinking about the business end of things I thought I would throw some ideas out there.
1.) Consulting – being a consultant means that you charge people for your time and expertise. You clients will get great value from you and you will get a big upfront payout. Some consultants on the iPhone will command $100, $125 and even $150 per hour.
2.) Build an Ad-Supported App – this approach depends on building an app that you own and putting ads in it. It makes money when people click on your ad. If you are not comfortable with charging people directly for money but still want a passive income, this could be an option. However, be prepared to create something a lot of people will want to use frequently.
HINT: Passive Income means money you receive without putting in your time. Think rent money or sales from a product over time.
3.) Sell an App Directly to a Niche - this is my business model. I know that there is a small audience for people who want to organize their wine notes. So, I found out what they wanted, built it and then sold it to them while incorporating their feedback.
4.) Try to Hit the iFart Lottery – apps like iFart and others that are simple to create but capture everyone’s imagination can make you an instant millionaire. Of course, for every successful iFart there are twenty less successful flatulence inspired apps. Pay attention to what the top apps do and try and learn from them. Be prepared to try and drop a few apps before you hit gold.
5.) Loss Leader – this scenario assumes that you have a desktop application that you can sell. Essentially, you give the iPhone app away for free hoping to inspire prospects to buy your more expensive desktop app. To keep it in perspective, desktop apps can easily cost $29 a shot. 1Password is a great example of this approach.
That is it for my ideas. What do you think? Any other ideas to make your iPhone business dreams a reality?
This Week in Awesome iPhone Developer Resources
The longer I work on this website and my own apps, the more cool resources I have been finding online to help people doing development work on the iPhone.
This week I want to highlight 5 resources that I have been going back to all week (all month really).
iPhoneKicks
If you are familiar with Digg.com, you will get this website that is a digg clone dedicated to iPhone development topics. I use this site and the one below to keep myself exposed to new programming topics I would not normally encounter myself.
iPhoneFlow
iPhoneFlow is similar to the site above, but doesn’t have a voting mechanism that I can see. Essentially, people submit links to iPhone resources that they think other developers will find interesting. Subscribing the RSS feed is like getting access to a iPhone developer stream of consciousness.
iPhone Dev SDK
This is a more traditional forum type resource. I check this forum every day, ask questions here and sometimes answer questions. It is my first stop place to get iPhone development help. All three of these sites have automatic Twitter updates that I use to stay in touch – it is a little more timely that simply using a RSS reader.
614 iPhone Developers on Twitter
If you are curious about what it is like to be an iPhone developer you can actually “follow” 614 of your favorite iPhone developers on Twitter. Twitter is a micro-blog where people post short 140 character messages throughout the day. Reading twitter posts is like being a fly on the wall in the life of the hundreds of iPhone developers that use it. The link above has directions written by one of the twitterati (@snoonan) and posted on my personal blog.
Internet Business Mastery Mastermind Group
This is the resource I use to help me with all of the business aspects of running my iPhone business. IBMA helped me form my LLC, do marking, find graphic design and copywriting – essentially all the “business” parts of learning how to run an iPhone business. But, the most important thing is that they provide a “mastermind” group.
If you have read books like Think and Grow Rich you will know what this is – your personal board of expert advisors that help you succeed in business.
The Internet Business Mastery Mastermind Group has been one of the best investments I made in my business so far.
That is it – if I end up finding more resources next week I will do another post like.
My QUESTION to YOU is :
What are your favorite resources for iPhone development right now?
If you can’t answer that one:
What resources would you like to see that are not there yet?
Dude, I Outsourced my iPhone App!
There are three, actually four ways, that an independent solo-preneur may use to get an iPhone app on the App Store:
- design and code it him/herself
- design it and hire a consultant to code it
- design it and partner up with a programmer to code it
- buy someone else’s app
Do It Yourself, Become a Pro or Hire a Pro?
Personally, I took the first approach – because I was broke and I enjoy writing code. However, in the long run – hiring out portions of a coding project or even an entire project is something that will have to be considered to move a project from the smallish time to the big time. Having a solid understanding of the iPhone technology will be a big help in this. For a small business owner who is hoping to hire programmers you will need either a high level understanding of the iPhone or the ability to hire a savvy technology person who has some system analysis or design skills.
Hey, Wanna Partner Up?
As an iPhone developer, you will get requests to partner up or to hire out your iPhone programming skills. As a entrepreneur you have the next great idea but no programming skills and need fantastic talent to make it happen. Doing this is a matter of personal choice – are you the lone wolf or the team player? If you decide to partner, make sure that your partner brings something more than an idea to the table. Either your partner can do half the coding or they can bring something to the table that you cannot do well like: marketing, graphic/audio design, existing mailing list, an existing brand, startup money or a strategic partnership with a big company.
Hungry Big Fish Looking for Tasty Small Fish
If you have deep pockets and are missing either programming talent or ideas you could try to buy someone else’s work. The advantage here is that you will have an idea of how an existing app will perform financially. A possible disadvantage is the flexibility of Apple when it comes to transferring rights of developers to other developers. This is one of the murky areas when dealing with Apple and there is a risk that the deal cannot go through or that the product would need to be re-branded.
What to do?
Of course, this has a lot to do with your business model and what your goals are with this whole enterprise. Have a neat idea and want to give yourself a raise this year to supplement your day job? Might as well learn a few things and put an app or two out. Want to start a business and have some seed money? Outsourcing could jump start your business. Want to be a hired gun – clearly you need too get your skills up and learn how to find clients.
Long Term Plan…
Regardless of your startup plans, you may want to consider learning the skills you need to take advantage of outsourcing. A small group of people can magnify your reach and the quality of your work. Knowing how the iPhone works will help you with this – even if you do not work on every detail yourself.
You Must Check Out this Website:
Making iCombat
- this blog is a candid recount of experiences with outsourcing that the author is having right now. The authors seems to have learned what he needed to about the iPhone SDK and is now working with developers overseas to actually implement the app. I will be following this blog closely.
oDesk
- this is the site the person above used. Looking at it quickly, I saw quality developers offering $33/hour for their work. There is a range in cost and quality and you may need to overcome some language and cultural differences. But, it is an option.
So, tell me what you think of this?
Would you consider outsourcing, partnering up or coding your own apps?
NSZombie and XCode Oh My!
Today I was reading my second favorite iPhone programming website, iPhoneKicks.com, when I can across this article:
http://www.mobileorchard.com/14-essential-xcode-tips-tricks-and-resources-for-iphone-devs/
You can find some of these tricks helpful as you start to get more familiar with XCode. In particular, I saw in the comments a mention of NSZombieEnabled. Cool name right?
It is way more than that – if you have encountered memory problems (aka – your app crashes for no apparent reason because you attempted to use an object that you deallocated to soon) setting NSZombieEnabled = YES can help you diagnose the problem.
Normally, when your app crashes in this way and you look at the log it tells you nothing (thanks Apple!). However, if you select your executable (under Executables in Xcode), hit the info button (round blue thing at the top), select arguments and put this in the bottom screen NSZombieEnabled = YES the log will give you more information.

Now, if your app crashes the log will have an indication of the object you attempted to access that has already been deallocated. Not forget to turn it off before you deploy it – you don’t want a bunch of nszombies running around your clients phones…
A Digg Clone for iPhone Programming Articles
You may be familiar with Digg, the social networking site where people submit articles and people vote on them to get them up to the front page. Discovering content is very easy with this site.
Now, there is a site just like this but only for iPhone programming articles. This is a gold mine for anyone looking for iPhone programming help. It may not be beginner material, but as you move along in your development work it may be a good resource to check out.
The site is called iPhoneKicks and the URL is:
http://iphonekicks.com/
Check it out and let me know what you think in the comments below.
What is Model, View, Controller Supposed to Mean?
Normally, for this blog I do not like to focus on nebulous concepts like “design patterns” or best practices or anything like that. This simply because I would like to see you get into the coding as fast as possible so you can start learning some of these more complex issues as you come across them.
Model, View, Controller, Oh My!
However, this idea of using the “model, view, controller” (or MVC) design pattern is so prevalent in iPhone programming that some mention should be made of this.
Design Patterns
First of, I like to think of “design patterns” as a way to think of how the various pieces of your software work together. Lots of time when you are coding you are just thinking about working on one line of code at a time or maybe one unit of something at a time (method, property, function). When you are in the mindset of using design patterns, you are thinking of how your units, or pieces, are fitting together. Design patterns have to do with system architecture.
Overview
The Model, View, Controller (MVC) design pattern is one way of looking at software development that the Apple engineers put into the Cocoa frameworks (part of the iPhone system). Here are the three pieces of the MVC pattern:
- Model: the abstract data about your problem space
- View: the visual elements of the application
- Controller: code that glues the model and view together

Example
As an example, think of an iPhone app that is used to maintain a task list. The app would simply display a list of tasks that users check off as they are completed. Here is how the MVC pattern would fit into this app.
Model
Our example app model would be an object that contains the list of tasks, the state of each task and some code to make the task data persistent.
View
Our view would be an object that contained a table with cells that allowed text entry and user interaction (GUI elements).
Controller
Our app’s controller object would know about the Model and the View. Controller will respond to user input and inform the view to update it’s visual elements or have the Model perform some action to the underlying data.
In a lot of ways this is a real simple idea and after some practice with the concept it makes a whole lot of sense. There is a bit more to how it works on the iPhone, but you will have plenty of time to see that.
Here are some resources in case you are interested in using Design Patterns in your own software. Learning about design patterns changed my software development style profoundly so I cannot recommend learning a bit about this idea more.
Design Pattern Resources
Design Patterns Explained: A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series)
-This book uses Java in its examples, but the syntax is not all that important to the concepts discussed.
C# 3.0 Design Patterns
- This book is similar to the one above, but uses C# syntax so it may be worthwhile if you are more familiar with .NET programming.
Cocoa(R) Programming for Mac(R) OS X (3rd Edition)
- The gold standard for learning Mac programming. This book also specially goes into the architecture level stuff discussed here. More importantly, it does a great job of giving you the flavor of developing on the Mac (and iPhone by association). This one helped me start to make sense of the Mac development mindset.
The Model, View, Controller Song
- Someone loved MVC enough to write a song about it!
And of course, I have a mailing list where I discusses these issues and give beginning iPhone programmers weekly tips that you can subscribe to here:
How Much Does it Cost to Become an iPhone Developer?
The short answer to this is $99. This is how much it technically cost to get a license from Apple that will let you put your iPhone apps on your phone. Lately, I’ve been thinking about what the overall cost of learning iPhone programming was for me. Maybe this is just because this is the time of year where I need to talk to my accountant about taxes and what my learning budget is for next year (you do list the money you spent in your education and re-training as a tax deduction right?).
For me, the overall cost of becoming an iPhone developer was much greater than $99. It took me about three months, a trip to the a conference on the West Coast, a new laptop and some books. Not counting my time, I spent about $5000 overall to learn how to program on the iPhone. Not too bad considering. Of course, if I figured in the time spent on learning this the total goes up to $16,000.
Clearly, the most expensive part of all of this is my own time – even more than the cost of the laptop, training and conference. Of course, it seemed to pay off in terms of allowing me to quit my previous job. The take away message for me is that I need to pay more attention to decreasing the “time investment” as opposed to the “money investment” when it comes to learning new technologies – because, as well all know working in the technology field requires learning the next new thing often. And when you are self-employed, time costs more than money.
Don’t worry though – investing in learning iPhone programming is much more sound than investing in Wall Street.
Video Demo: How you get pictures into the iPhone Simulator
This was a problem I had early on – most of my apps required use of the camera or the photo library. For the longest time I believed that you couldn’t test the photo library on the simulator. I was wrong, it is actually pretty easy to get pictures into the simulator for testing. Here is a video demo of me doing just that:
Essentially, all you need to do is drag a picture file onto the Safari icon in the simulator and when it shows up click on it until you get a “Save Image” dialog. Press that button and presto – your image will be in the photo library.
Newsletter
Find Stuff
-
Everardo: Quick question on the last example with the swtich...
-
RRT: Thank you very much!...
-
MattjDrake: Hi Miguel, Thanks - what you see is what I have...
-
Miguel: Matt, These are great tutorials. Have you done...
-
Harold: Thanks for the tutorial, busy with my first non-ni...
-
How To Design A Custom UITableViewCell From Scratch
November 17, 2011
-
Using Blocks with Table Views
November 1, 2011
-
Using Storyboards To Make Navigation Based iPhone Apps
December 15, 2011
-
How to Make Your iPhone App Send Email with Attachments
July 14, 2009
-
How to Play a Short Sound in iPhone Code
August 17, 2009
-
Our iPhone Training Sneak Peak!
May 8, 2012
-
iPhone Training
May 2, 2012
-
How to Archive Your Object Graph
April 26, 2012
-
Here’s Your Free iMAM iOS SDK Training Module
April 19, 2012
-
Some Crazy New Updates to iMAM
April 13, 2012
Topics
About Matt
In 2008 I left my cubicle to make iPhone apps full time and now I want to help you!



