Unified Contacts

14 April, 2014

How to check where is the exception thrown

Sometimes when the exception thrown. Xcode just shows the memory status, but not exactly the line of code. If you want to see where is the exception thrown. You can add a exception breakpoint.



1. click the breakpoint tap on the left side navigators window.






2. on the left bottom, click the + button and then click "Add Exception Breakpoint".


3. now, when exception is thrown, Xcode will show which code has a problem.


11 April, 2014

Call URL: tel vs telprompt

Both tel: and telprompt: can make a phone call. But what is the difference?

For tel:, iPhone will make the call immediately and will state in Phone app after the call.

For telprompt:, iPhone will ask whether you want call this number and will return to your app after the call.

Be aware that sometimes address book returns the phone number with white space or non-break space. It causes the NSURL returns null. The following code can filter out these 2 types of space.

NSString *phoneNumberString = [[self.tableView.detailTextLabel.text componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:@""];