1

Closed

ODataRTTI nsdata encoding

description

In +(NSString )getObjectInstanceVariableValue:(id)object variablename:(NSString )varname isComplex:(ODataBool *)complex
 
you have:
else if(strcmp(type,"@\"NSData\"") == 0)
{
    NSData *data = object_getIvar(object,var);
    if(data)
    {
        NSString *strvalue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
        if(strvalue)
            value = strvalue;
        [strvalue release];
    }
}
 
 
if data is binary data, the string created by NSString *strvalue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; will be null.
 
I use something like NSString *strvalue = [data base64EncodedString]; where the base64EncodedString is from Matt Gallagher's NSData+Base64 work (http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html)
Closed Sep 8, 2011 at 3:52 AM by abub
Fixed in Version 1.3

comments

abub wrote Sep 8, 2011 at 3:52 AM

Fixed in Version 1.3