wsdl2objc NSString error
In mi wsdl2objc generated code I have:
@interface tns6_EntityType : NSString {
/* elements */
/* attributes */
NSNumber * id_;
}
However, when 开发者_如何学PythonI get an element of this type, I get the following error:
2011-03-26 21:23:02.428 Pez[47129:a0f] Exception detected while handling key input.
2011-03-26 21:23:02.428 Pez[47129:a0f] * -length only defined for abstract class. Define -[tns6_EntityType length]!
Does anyone know how to fix this?
Thanks
It looks ilke you need to add your own implementation for -length
on the class tns6_EntityType
. Remember that in Objective-C, NSString is the abstract parent of a class cluster, and so subclassing it directly can sometimes have strange effects. If you continue to get errors like this, just read through the message and follow its directions.
I had the same problem when generated wsdl code to objC.
You can find my solution for this problem here: https://stackoverflow.com/a/21331422/1891772.
In my example I used ARC. As I know wsdl2objc doesn't support ARC so you need change it my example:
- Change in "stringHolder" property "strong" to "retain"
- add "autorelease" to code line where property "stringHolder" initialized
- add "self.stringHolder = nil" in dealloc method
精彩评论