views:

80

answers:

1

We're integrating a library into an iPhone app which appears to use the google toolbox for iPhone internally. The google toolbox adds a method gtm_stringBySanitizingAndEscapingForXML to NSString. The problem is, whenever we attempt to make a call to this library we get

[NSCFString gtm_stringBySanitizingAndEscapingForXML]: unrecognized selector sent to instance 0x272478

So it appears the library is calling that method on a NSCFString, to which the category does not apply. So... is it the case that the category will not apply across the toll-free bridge to CoreFoundation classes? If that's the case then we at least know why it's blowing up. Figuring out how to fix it is a different matter.

+2  A: 

Categories applied to NSString do apply to NSCFString as well, because NSCFString is a subclass of NSMutableString which is a subclass of NSString.

But have you actually included the Google Toolbox library (GTMNSString+XML.m)?

KennyTM
The google toolbox is built into the library, so if we include it we get errors because of classes be re-defined.My co-worker has actually solved the problem, there was a linker flag that caused it to break.Thanks for your answer.
half_brick