Posterous theme by Cory Watilo

In-app Purchase Patent and What iOS developers Should Know About It

There has been a patent troll going around contacting iOS developers who are offering in-app purchases, informing them of patent infringement. FOSSpatents has put up an article detailing what iOS developers should know about it. It also mentions (note that this are educated guesses, not facts) about how Apple and other companies including Google who also run similar app store might react. Do yourself a favor and read it even if you are not utilitzing in-app purchase today.

Using ctags with MacVim for Objective C on OS X

  1. Install Homebrew if you haven’t.
  2. Run brew install ctags. The version of ctags that ship of OS X is an antique.
  3. Run echo "--langdef=objc" >> ~/.ctags && echo "--langmap=objc:.m" >> ~/.ctags && echo "--regex-objc=/^[\t ]*(\-|\+)[\t ]*\([_a-zA-Z0-9][_a-zA-Z0-9]*\)([_a-zA-Z0-9][_a-zA-Z0-9]*)/\2/f/" >> ~/.ctags
  4. cd to the directory to write the tags file in
  5. Run ctags -R mytargetdirectory
  6. Press ^] in MacVim over a function name to go to declaration/definitions

PS: Creating the .ctags file is so convoluted because I can’t figure out how to put a multiliner without ruining the formatting in the instructions.

My SimplyTweet Punch Card

I use GitHub to manage my code and I thought it's interesting to look at my commit activity for SimplyTweet. GitHub has an excellent tool for this called Punch Card. This is how it looks like for SimplyTweet:

Screen_shot_2010-06-04_at_pm_02

It shows the relative number of commits (rough equivalents of changes if you are consistent) performed across the duration of the project. You can see that

  1. I am most productive (again, commit-wise) the few hours around 12am and 12pm.
  2. I am least productive on Fridays.
  3. I seem to be slightly more productive during midnight than noon.
  4. I work on Saturday nights.
  5. I work on Sunday nights
  6. I work everyday.

Does anyone else has Punch Card graphs they like to share?

How to Report a Bug in a Software to the Developer

As a software developer, I often receive bug reports. As with all software developers, I can't make sure my software doesn't get released without bugs, but we most certainly want to fix bugs which are reported.

Here's what as a user, how you can help us:

  1. Let us know what you were doing when you saw the bug. Is there a way to reproduce the bug reliably? It's always easier to fix if you can help the developer see the bug for himself/herself. This is the single most important thing you can do for the developer to help fix a bug.
  2. If it's something that can be seen on the screen, a screenshot helps.
  3. State which version of the software are you running on.
  4. State which version of the operating system are you running on.

 

Can't Download Xcode Because Session Keeps Expiring

The latest Xcode beta is out and you rush to download it from Apple. Except, when you click the download button, it says your session has expired. You login again and it happens again. And again. Email support didn't help. It might be a problem with you being behind a proxy server.

Here's a workaround, I use:

  1. Get a VPS or something that lets you run your own server and software, if you don't have one. I use Slicehost (referral link).
  2. You also need ssh to be setup on the server.
  3. Install tinyproxy on it and run it.
  4. Point Safari to your web proxy (the host name and port number for your tinyproxy instance)
  5. Login with Safari to download Xcode, the download should start.
  6. If you have a fast connection, just let it finish and you are done. Remember to stop tinyproxy.
  7. If you have a slow connection locally, stop the download now, copy the URL of the download. Remember to stop tinyproxy.
  8. Open ~/Library/Cookies/Cookies.plist and look for ADCDownloadAuth, copy the cookie value.
  9. On your server, run: wget --no-cookies --header "Cookie: ADCDownloadAuth=<cookie value>" <link>
  10. Once download is complete, run rsync --partial --progress --rsh="ssh -p <port>" user@remoteserver:/path/to/source <local destination>

Disable Callouts for Links with Custom Schemes in UIWebView

You use a UIWebView in your iPhone app to display HTML content. You add clickable links that your application handle via custom schemes (foo: instead of http://), e.g. foo:somevalue so when someone taps that link, you know what it was for and act accordingly.

You test out your app and the links work great.

Unfortunately, when press and hold the link, a callout for the link appears, revealing foo:somevalue.

The solution? Add a bit of CSS to each affected link so that it looks like:

(You'll see an interesting effect when you press and hold on the link.)

Script to Remove Core Data's SQLite Database File During Development Cycles

During development of applications that uses Core Data on the iPhone, I find myself often wanting to delete the SQLite database file. This is especially common in the earlier stage where the schema isn't finalized yet. Here's a script that helps with that, building on Craig Hockenberry's Open sesame script.

Save the script as clearcoredata, make it executable. To delete the SQLite database file, run: clearcoredata <app name>.