My simple class, ClassWithOneArray, produces this error:
Bitcast requires both operands to be pointer or neither %19 = bitcast i64 %18 to %objc_object
In my experience simply declaring the Protocol "NSCoding" to your class should do the trick. Hope this helps someone.