Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 6 NSDictionary from JSON File
    primarykey
    data
    text
    <p>I am building a project using story boards and a <code>MasterView</code> layout. I'm trying to get the <code>UITableView</code> data from a JSON file (<a href="http://afterimagedesign.tk/topHits.json" rel="nofollow">http://afterimagedesign.tk/topHits.json</a> I don't know if this is correct JSON or not, I'm new) so I call these methods in <code>viewDidLoad()</code></p> <pre><code>responseData = [[NSMutableData data] retain]; NSURLRequest *topHitsRequest = [NSURLRequest requestWithURL:[NSURLURLWithString:@"http://afterimagedesign.tk/topHits.json"]]; [[NSURLConnection alloc] initWithRequest:topHitsRequest delegate:self]; </code></pre> <p>and then in <code>connectionDidFinishLoading:(NSURLConnection *)connection</code> method, I call this:</p> <pre><code>[connection release] NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; [responseData release]; NSDictionary *topHitsDictionary = [responseString JSONValue]; NSArray *topHitsArray = [topHitsDictionary valueForKey:@"title"]; </code></pre> <p>The problem is (I think) that I get this error: "Instance method '-JSONValue' not found." I have looked for this for a while, and all of the tutorials I've seen use this method. Is it iOS 6 or something else? Thanks!</p> <p>EDIT:</p> <p>How do I add it to a UITableView? I tried <code>cell.textLabel.text = [self.topKpop objectAtIndex:indexPath.row];</code> but I keep getting a SIGABRT error. I have gotten SIGABRT error, but this time it's in the .m file.</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.
 

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