iOS and Xcode Tips

This article is intended to host various tips for building and debugging iOS applications.

 

Build fails with illegal text-relocation issues

If you the following errors when building for the Simulator (x386) or an arm64 architecture:

ld: warning: too many personality routines for compact unwind to encode

ld: illegal text-relocation to '_vp8_dequant_idct_add_mmx' in /Users/nathan/Desktop/Workspaces/SDK-iOS/ACBClientSDK.framework/ACBClientSDK(dequantize_mmx.asm.o) from '_vp8_dequant_idct_add_mmx' in /Users/nathan/Desktop/Workspaces/SDK-iOS/ACBClientSDK.framework/ACBClientSDK(dequantize_mmx.asm.o) for architecture i386

Add the following to Build settings -> Linking -> Other Linker Flags:

 -read_only_relocs suppress

 

Uninitialised Variables

In iOS, if a variable is undefined and referenced during execution, rather than get a Null Pointer Exception like Java, the call to the uninitialized variable will fail silently. From an applications point of view, this could manifest in expected behaviour not executing.

This is easy to debug by putting a breakpoint on the initialisation code, and a breakpoint on where it is referenced, and see which is called first. You could also add test code e.g. if (something == nil)

 

 

 

 

 

 

Comments are disabled on these articles if you require help contact support@cafex.com.

Have more questions? Submit a request

Comments

Powered by Zendesk