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,
Peter