ASFixed Numbers in XCode

Feb 5, 2010 12:00:00 AM | Acrobat SDK ASFixed Numbers in XCode

The XCode debugger will not display ASFixed numbers correctly by default. To properly format them, add a Custom Data Formatter in the form of an XML file.

by Mark Gavin

The XCode debugger will not display ASFixed numbers correctly by default.  You need to add a Custom Data Formatter which contains the instructions to the XCode debugger on how to properly format an ASFixed number for display.  These instructions are in the form of an XML file named CustomDataViews.plist; located in the following path:

(~/Library/Application Support/Apple/Developer Tools/CustomDataViews/CustomDataViews.plist)

Following is a screenshot of how the ASFixed number “100” is normally displayed in XCode:


Displaying ASFixed numbers in hexadecimal can sometimes help:


But using a Custom Data Formatter will take the ASFixed numbers; reformat them and place them in the debuggers Summary column:


The following image is a screenshot of what you will see when you open the file using the Apple Property List Editor:


Following is the contents of the CustomDataViews.plist file:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
 <plist version="1.0">
 <string>{((float)($VAR) / ((ASFixed) 0x00010000)))}</string>
 <key>File Version</key>

Written By: Mark Gavin