Sudzc how to use returned object from ws call

Sudzc generated stub:

(void)HandleSearchResult: (id) value { ...

The document indicates that the value can be added to (SDZSearchItemsByUpcResponse *). However, this was incorrect.

In Xcode, the type "value" looks like __NSCFDictionary.

+3
source share
1 answer

__NSCFDictionaryis a concrete subclass of both NSDictionary, and NSMutableDictionary. Handle this way:

-(void)handleSearchResult:(id)value {
    NSDictionary* dict = value;
    NSLog(@"value is: %@", dict);
    // Do what you want with your dictionary
}

I would skip SudzC and use CWXMLTranslatorfrom https://github.com/jayway/CWFoundation . This allows you to ignore most critical SOAP XML responses and translate them directly to the corresponding domain objects, rather than dictionaries and other placeholders.

+3
source

All Articles