willia4 / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
1 stars 0 forks source link

Extending a string type fails #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use an xsd with a complex type that has simpleContent as a string, with an 
extension

What is the expected output?

Some kind of object where the string as well as the extension attribute can be 
set

What do you see instead?

A string subclass with the extension attribute. The problem is that subclassing 
strings is not 
easy, and cannot be done the way it's done currently.

There are a couple of possible solutions:
First, we can use the NSAttributedString class instead of the NSString class. 
This is elegant, but 
the problem is that it's only available on iPhone OS 3.2 and above.

Second, we can use the default NSObject class, and use the "_content" attribute 
as the string 
value. This is not so elegant but works pretty much universally.

Third, we can really subclass NSString and go for it.

Original issue reported on code.google.com by hasse...@gmail.com on 26 Apr 2010 at 9:05

GoogleCodeExporter commented 9 years ago
Beginning in revision 177, I've implemented the strings with attributes as 
follows:
An XSD string that has attributes will be mapped to an NSObject that has a 
property called "_content" which holds the actual string.
Of course it will have all other defined attributes as properties.

Original comment by hasse...@gmail.com on 9 Sep 2010 at 1:02

GoogleCodeExporter commented 9 years ago

Original comment by hasse...@gmail.com on 9 Sep 2010 at 1:02