I don't know that library, but the code that you wrote cannot possibly work.
isValidJSONObject is a method that checks whether you have an object that can be serialised to JSON, that is an NSArray or NSDictionary containing only keys and values that can be serialised to JSON.
JSONObjectWithData is a method that takes an NSData object and deserialises it to an NSArray or NSDictionary.
Since an NSData object will always fail in isValidJSONObject, and an NSDictionary or NSArray is never valid input for JSONObjectWithData, one of these calls must fail.