Dotnet developers reference to Xcode, iOS, iPhone development

Been working on an iPhone app for our organization, and being a full-time DotNet based developer working on Xcode and iOS development had its quirks. I am documenting my experience on the first few runs so that others can benefit on the same.

Adding existing project to a local GIT repository

Terminal to the folder where the root of the project is and give the following commands

git init
git add .
git commit -m "Initial Commit"

Tip from http://ashfurrow.com/2011/03/how-to-create-git-repos-for-existing-xcode-projects/

Setting conditional breakpoints in Xcode

Add a normal breakpoint and then Ctrl+Click on the breakpoint and select Edit Breakpoint. Here you can give the condition under which the breakpoint activates.
Tip from http://stackoverflow.com/a/989815

Stepping through code

Once you have hit the breakpoint, to step through the code find the controllers in the debug area (normally next to the output window). This area would have the buttons for Continue,Step over,Step into, Step out.

Remove all breakpoints in Xcode

Well there’s a two-step way:

  1. Press CMD(⌘)+ALT+B to show all breakpoints. UPDATE:In Xcode4 pres CMD(⌘)+6
  2. Select all breakpoints and delete them, like deleting text, with backspace.

Tip from http://stackoverflow.com/a/1665772

Planning to update this post as I keep discovering new ways of doing old things, do keep checking back.

Notable freeware lists

Some of the best freeware lists for your needs:

  • Gizmos freeware reviews: Provides useful comparison of various freeware tools sorted by reviewers rating.
  • MakeUseOf – Windows, Linux, Mac: Another great collection of useful software (not necessarily freeware). Do check out their site for other categories like Android, iPhone, iPhone and such
  • Addictivetips: A great blog with information related to useful software and tweaks.

Email validation using regex

I believe using regular expression is a very bad idea for validating an email address. The main issue seems to stem from the fact that regex is primitive tool to validate the complexity in email grammar, as specified in RFC 5322.

Recently I tried registering for an account at the RTA mobile site at http://www.mpark.rta.ae, all went fine except for the fact that my valid email account which I have been using since 2006 is not recognized as a valid one.

RTA Registration Form

I tried to find out the mechanism they are using to validate the mail, and as expected it was based on a regular expression located as part of their script repo. The script we are interested is located in a JavaScript function called isValidEmail which goes in the following way:

function isValidEmail(str) {
   //var re=/^.+\@.+\..+$/;
   var re=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
   return re.test(str);
}

As it is visible from the above code the regex used will not validate my 4 letter TLD. This is a bad practice and if you are a client facing website, it will sure put off potential clients.

For the RTA site, I simply set a break-point on the return statement and reassigned the variable re to /./, this allowed me to bypass that validation and proceed with the registration.

Go back to top