is a PAIN IN THE ASS!

I’m trying to replicate the new message screen you see in the iPhone email app screen, and it’s a major pain in the butt.  I’ve got it all set up like this:

UITableView

-> Custom cell:  AddressCell

-> Custom cell: AddressCell

-> Custom cell: SubjectCell

-> Custom cell: MessageCell

AddressCell, SubjectCell and MessageCell are all classes that inherit from UITableViewCell.  In their init functions I programatically build up the functionality of each cell.  AddressCell’s get a label for “To:” or “Cc/Bcc:” and a UITextField for the address.  SubjectCell’s just get a label for “Subject:” and a UITextField.  These work fine, no problem whatsoever getting them to work.  The trouble came when I went to make the MessageCell class.  It seems that UIScrollView objects do not like being embedded in other UIScrollView objects.  Because the MessageCell needs a UITextView (which is a UIScrollView) and the cell is a part of a UITableView (which is a UIScrollView) I ran into this problem.  Once you began editing the text view you couldn’t scroll the table anymore.

The solution it seems is to make your own UITextView class that passes on the touch events to the “parent” scroll view.  I learned this from a nice guy’s post on the dev forums.

It’s frustrating to lose time to this kind of stuff when there’s so much other work to do.  Losing time like this never seemed like a big deal before when I was an employee, but as a business owner every day I waste on stuff like this is money out of my pocket and that hurts.

 

I completed the process of migrating from an individual to a corporation on Apple’s developer portal today.  It seems that if you’re ready for it this is a very easy process actually.  All you need to have is documentation at the ready to fax to Apple to prove that your company exists.  Then get it started by calling the developer support guys and get them to forward you on to the migration team.  It takes a couple of days but is painless.  So now we’re all set up with Stormtap as a company that can publish iPhone apps, just need to get that banking info in now so we can upload non-free apps!

 

This week we’re hauling ass on our next app, doing some heavy coding.  We’re also trying to finish the process of getting all set up to do business.  We need to get a corporate bank account, finish registering as collectors of GST and finally submit all of our banking and tax information over to Apple so that we’re ready to upload and sell applications.

As I type this I’m on the phone with Apple dev support.  We need to figure out how to convert our individual enrollments in the iPhone Developer program into one account for Stormtap.  I’ve read some posts on the iPhone dev forums about this and apparently it can be a difficult thing to get done.  My guess is that the easiest way to do this is likely just to suck it up and pay to re-enroll directly as Stormtap.  We’ll see I guess.

Then I’ve got to phone the IRS and figure out how to get an EIN (Employer Identification Number).  We need this to fill out a W-8BEN form as a foreign company, I’m not sure yet what this form does, and why the IRS needs to be involved with us anyways, but we’ll see.  This will cost some money to get I’m sure.

 

Beware unexpected costs

On February 23, 2009, in Entrepreneurship, by admin

Starting up a business is something I’ve done before from the employee side.  I’ve been at a few startups now, some successful and some not.  I’ve got a lot of experience on the side of generating the material that the business uses to make income, but not as much on the behind the scenes day to day expenses and costs of doing the business.  Unfortunately this lack of experience is showing right now.

We’ve got a list of things we need to figure out prices for still, but here’s some rough tallies on what we’ve spent, and what we expect to spend in the near future:

Incorporation Fees (Lawyer)  – 1200.00
GST registration – 600.00
Website – ?
Whose Turn Is It App Logo – ?
Quickbooks software – 199.00
Domain registration & hosting fees – ?
Accounting year end filing – 2500.00
Fees when applying to IRS and what not for account numbers – ?
<Unannounced> app logo – ?
Logo Design – ?
Buying cheques – ?

Some of these costs we’d planned for, but some snuck up on us (like how much it would cost to file our corporation’s year end, or how much it costs for lawyers and accountants to talk to each other).

 

Stormtap Studios Limited

On February 20, 2009, in Entrepreneurship, iPhone Development, by admin

Well we’ve got our name sorted out.  Our company’s birthday is one day after mine, so it should be easy to remember anniversaries.  Hopefully we have anniversaries.  Now that we’re registered we can begin the process of getting all of our documents and banking information sorted out with Apple.  I’m sure that will be very tedious.

Work is coming along quit well on our next application.  We’ve faced quite a few set backs so far, but each time we’ve been able to find ways around them.  Generally they are issues where the SDK prevents us from doing something the way we originally designed.  Luckily we’ve been able to find alternate solutions.  I am worried though that at any moment we’ll run into some big whammy issue in the SDK we don’t know about that completely blocks us from being able to create the app we want.  Only experience with the platform is going to save us from disasters like that.

 

God I hope we don’t need support…

On February 18, 2009, in iPhone Development, by admin

Today I received a reply from Apple’s developer program’s support team, in response to queries I made about information needed to be able to sell our applications on the app store.  My question was a simple “what info do you need from us in order for us to be able to sell apps on the app store”.  You would think this would be some information that they would have quite handy and available to you nearly instantaneously.  Far from instantaneous, the quest for this answer has so far gone on for 15 days.

February 3rd ->  Called Apple dev support, the guy promised to send me a list of information he knew about.  Which he did.  But, told me to email itunesconnect@apple.com for more detailed info.

February 9th -> Received email from iTunes Connect, telling me to email devprograms@apple.com and ask them.

February 18th -> Received email from devprograms@apple.com calling me Michael and asking me to instead ask the tax team for the info (iTStax@apple.com).

Luckily as I’ve mentioned in my earlier posts I’ve managed to find all the info on my own in the meantime, because if I had to rely on this system I’d be set back I’m sure at least another 5 – 9 days waiting for replies.  This tells me my previous experience finaling video games for consoles like the PS2, Xbox, Gamecube and Nintendo DS and the nightmare of meeting their TRCs (Technical Requirements Checklists) will come in handy.  We’ll need to do everything in our power to do things right the first time so we don’t end up in this support email hell.

 

Well this week sometime you’ll be reading the official blog of a corporation’s CEO as ridiculous as that sounds for a two person company.  Mike’s the president.  It’s pretty hard to think of two equivalent in power titles for a company in my opinion.

It took us way too much time to figure out three names for the lawyers to go register our company with.   I hope this isn’t a bad sign of our creative abilities.  Unfortunately we were stymied by every word in the known universe already being registered by domain camping assholes.  No wonder digg, del.icio.us and all that other nonsense exists.  Good luck registering anything that’s a real word.  Don’t even think of trying to register a name with “mobile”, “fun”, “black” or any other cool word in it.  Stick to safe words like potato, carrot, bread.  These are your safe guesses at free domains.  Although I will bet you 1 million dollars that potatocarrotbread.com is registered by the time you read this post.  Refer to our non-existent CFO to collect.

I’ve divined some precious App Store knowledge about registering for taxes and what not:

  • Since we’re in Canada we DO need a GST number (which you should do anyways if you’re a business because even if you aren’t collecting it you can get all the GST you pay for things like office supplies and what not back).
  • We will need to register our company with the US IRS to get a TIN number.  A TIN number is basically the SIN number for companies.
  • Once we have a TIN we have to fill out a W-8BEN form and get it to Apple.  When we’re done these steps we’ll be able to sell in the US and Canada.
  • To sell to the rest of the world there’s a few more things to do, mostly to do with getting Apple all the right documents for your bank account and legal entity name.  Apple recommends you get all this stuff started while you are developing your app because it takes awhile.
  • Finally there’s some forms we have to fill out to be able to sell to Japan as well.  Not to sell per se, but to avoid withholding taxes.
  • You can find out all this info on the iTunes Connect site (which is not an obvious place to new iPhone developer folks who haven’t done anything with Apple before).

So I’m very anxious to get the final word on the company being set up, corporate bank account opened and all the rest of the non-programming side of things we have to worry about so that we can get back to the thing we’re good at.

 

Frustration

On February 11, 2009, in iPhone Development, by admin

I spent the day in massive frustration searching the developer forums for information.   Our next app requires the ability to send an attachment via email, so I was researching the feasibility of doing that.  Essentially we want our app to work the same way the photo app does (animate its object into an email message and then let the user enter the address and subject for the message and press send).  Unfortunately it’s not that simple for non-Apple developers it seems.

You can call out to the mail app using the mailto: URL scheme.  Here’s a document I found useful that lists all the URL schemes available on the iPhone.  This document doesn’t list sms: though which lets you call out to the text messaging app.  The drawback to the mailto: system is that even though you can get your data into the mail app (for example, let’s say you want to send an image you can simply inline the image in some HTML in the body portion of the mailto: URL) and there it is all nice, once the message is sent the mail app seems to strip the attachment away.  What a bummer this is.

Well plan B luckily had me run into some SMTP code that some kind fellow named Ian Baird wrote and posted on Google code for everyone to use.  It will suck for the user that now I need to ask them for their SMTP account information and all that nonsense, but at least we’re not completely shut out from doing what we want to do.

 

Memory leak detection made easy.

On February 9, 2009, in iPhone Development, by admin

Finishing up the Whose Turn Is It app today I started the process of making sure I’m all good for memory utilization.  After struggling to find out where some bad retain count logic was I ended up searching the Apple dev support forums and found a link to this blog describing how to use the LLVM / Clang static analyzer.  Basically this thing is like PC-Lint for Xcode and Cocoa.

I ran my project through it and got a sweet report that looked like this:

scan-build output

As you can see the report comes up in a nice web page format that provides you with a list of the leaks in your app.  When you click “View Report” you get a screen like this one:

picture-2

Which takes you right to your code and shows you where the problem lies and what to do to fix it.  It’s that easy.

 

Connecting up the GUI to the database for the Whose Turn Is It app today brought me back to my database class.  I’d filled out the guts of this class before January just as I was learning Objective-C, but now that the app’s been made and the structure of the classes have changed I had to re-write a lot of it.  Using sqlite3 on the iPhone is dead simple, and if you’ve done anything with databases before you’ll have it figured out in 5 minutes.  I’ve never been much of a serious database guy so I don’t know about the more advanced stuff and whether the system scales well or not, but for the simple stuff I’m doing it works quite well.

I’m using MesaSQLite to create the structure, and edit the initial content of my database for testing and what not.  It’s good, but I would like to find one that doesn’t crash as much.  It doesn’t crash a lot, but when you mess around in the table structure window sometimes you can kill it.  Please leave a comment if you know of a better one.