Advanced Breakpoints in Xcode

Xcode supports the possibility of setting symbolic breakpoints to inspect the status of your app when some odd condition occurs.

This can come in handy when you have a crash in some SDK method that will prevent the debugger from attaching to your app, or when the OS carries through an action that you cannot trace back to your code. There are time when Xcode will even show you a warning that something odd is happening in some method and suggesting to set a symbolic breakpoint on a given symbol to better understand what happens.

Most of the times, just setting a breakpoint on a symbol is enough. But, if that method is frequently used in your app, you will beed more fine grained control.

Say, for example, that you are passing a nil value or an empty string to UIImage.imageNamed. If you set a symbolic breakpoint on [UIImage imageNamed], your app will likely stop too many times for it to be manageable. What we would like to do is specifying the argument the method receives when the app should be stopped.

For that we can specify the condition associated to the symbolic breakpoint.

In our UIImage example, we can use $x2 == nil (or $r0 == nil on 32-bit devices, or $arg3 == nil for the simulator). If we want to check for an empty string, we would use [(NSString*)$x2 length] == 0 instead.

BTW, improper usage of UIImage.imageNamed like mentioned would lead to Xcode showing the message Error: CUICatalog: Invalid asset name supplied: ''.

Year-end encryption export declaration

1. Visit the report generator

2. Fill the data (specify N/A when not sure because it likely does no apply)

3. Choose 5D992 for Export Control Classification Number

4. Select MMKT for Authorization Type

Xcode Layout Constraints Debugging

When you get the dreadful “will attempt to recover by breaking constraint” warning in Xcode, just know you can use the constraint address to filter the view hierarchy in “View Debugging/Capture View Hierarchy” and identify the broken constraint.