Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It should probably be:</p> <pre><code>NSError *err; NSString *lunchFileURL = [[NSString stringWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *lunchFile = [NSString stringWithContentsOfURL:[NSURL URLWithString:lunchFileURL] encoding:NSUTF8StringEncoding error:&amp;err]; // if you're going to create a CHCSVParser yourself, the syntax is: CHCSVParser *p = [[CHCSVParser alloc] initWithCSVString:lunchFile encoding:NSUTF8StringEncoding error:&amp;err]; // or, if you're going to use NSArray+CHCSVAdditions.h, the syntax might be: NSArray *array = [[NSArray alloc] initWithContentsOfCSVString:lunchFile encoding:NSUTF8StringEncoding error:&amp;err]; </code></pre> <p>Note:</p> <ul> <li><p>You don't need to <code>alloc</code>/<code>init</code> the <code>NSError</code> object; these classes that take a <code>NSError **</code> parameter will create the autorelease error object for you if they encounter an error; otherwise they leave it alone;</p></li> <li><p>The <code>CHCSVParser</code> class method is not <code>initWithContentsOfCSVString</code>, but rather <code>initWithCSVString</code>;</p></li> <li><p>Alternatively, if you use the <code>NSArray</code> class extension, then the syntax is <code>arrayWithContentsOfCSVString</code> or <code>initWithContentsOfCSVString</code>; and</p></li> <li><p>You specified an encoding of <code>&amp;encoding</code>, but this parameter is not a pointer, so I don't see how that can possibly be right; I've just specified the encoding.</p></li> </ul> <p>I assume you want to use the <code>NSArray+CHCSVAdditions</code> category method <code>initWithContentsOfCSVString</code> or <code>arrayWithContentsOfCSVString</code> (which gives you an <code>autorelease</code> object), not the <code>CHCSVParser</code>, but it's up to you.</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.
 

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