Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, names are very important in building an SDK. Your names are a bit confusing. <code>CarData</code> sounds very much like it is related to an <code>NSData</code>. The typical name for "a class that holds information about another class" is a "descriptor." So, I would call this <code>CarDescriptor</code>. See <code>UIFont</code> and <code>UIFontDescriptor</code> for inspiration.</p> <p>Next, your <code>carWithData:onSuccess:onError:</code> very much sounds like it should return a <code>Car</code>, but it appears to be <code>void</code>. I recommend the following:</p> <pre><code>+ (void)createCarWithDescriptor:(CarDescriptor *)descriptor completion:(void (^)(Car *car, NSError *error))completion; </code></pre> <p>It is preferred to have a <a href="https://stackoverflow.com/questions/18362957/should-my-block-based-api-have-just-completion-or-both-success-and-failure-handl">single completion block, rather than two.</a> Do not prefix completion handlers with <code>on</code>.</p> <p>The <code>CarDescriptor</code> class should help you with your searching question as well, but it should not include things like limits. You should wrap that in a <code>CarSearchRequest</code> (or possibly just a <code>CarSearch</code>). See <code>NSFetchRequest</code> for inspiration. Whether you pass a <code>CarDescriptor</code> or need a full predicate depends on how your service manages searches. (Of course, you could always have code that converts a <code>CarDescriptor</code> into a predicate.) Again, look at how <code>UIFontDescriptor</code> is used to search for fonts for inspiration.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload