chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sutter, Peter" <>
Subject Browser binding implementation
Date Thu, 17 Apr 2014 12:17:27 GMT
Hi there,

I’m facing currently an issue with [NSJSONSerialization JSONObjectWithData:options:error:]
and would like to hear your opinion.
The method returns for keys that do not have a value the NSNull object.

E.g. when reading the repository info and the description is null on the server,

repoInfo.desc = repo[kCMISBrowserJSONRepositoryDescription];

repoInfo.desc has the NSNull object instead of nil. Is there a better way than to wrap this
"dictionary[<key>]” with a helper method?

Something like

+ (id)valueOrNil:(id)value


    return value == [NSNull null] ? nil : value;


But then we have to wrap all calls when accessing the value of the dictionary with such a
method and this would blow up the code.. or do I miss something here?

The other thing is I need to access the CMISSession within the CMISBrowserUtil so that I can
retrieve the type definitions (and also make use of the type cache) when converting the succinctProperties.

I could add the CMISSession as property to the CMISBrowserBaseService. From there I could
pass the session to the CMISBrowserUtil. Any objections or even a better approach as this
seems to me like a dirty workaround?

Best regards,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message