Json get a parameter can't access on it iOS
Posted
by
Usi Usi
on Stack Overflow
See other posts from Stack Overflow
or by Usi Usi
Published on 2012-10-14T14:36:59Z
Indexed on
2012/10/14
15:37 UTC
Read the original article
Hit count: 231
That's an example
{
"updated":1350213484,
"id":"http://www.google.com/reader/api/0/feed-finder?q\u003dProva\u0026output\u003djson",
"title":"Risultati di feed per \"Prova\"",
"self":[
{
"href":"http://www.google.com/reader/api/0/feed-finder?q\u003dProva\u0026output\u003djson"
}
],
"items":[
{
"title":"Home Page - La prova del cuoco",
"id":"http://www.laprovadelcuoco.rai.it/",
"updated":1350213485,
"feed":[
{
"href":"http://www.laprovadelcuoco.rai.it/dl/portali/site/page/Page-ffb545b4-9e72-41e5-866f-a465588c43fa-rss.html"
}
],
"alternate":[
{
"href":"http://www.laprovadelcuoco.rai.it/",
"type":"text/html"
}
],
"content":{
"direction":"ltr",
"content":"Diventa un cuoco provetto con “La Prova del Cuoco”: le videoricette in un' applicazione di facile e veloce consultazione per il tuo Iphone. Scopri come acquistare ..."
}
},
{
"title":"Le prove Invalsi di matematica e italiano",
"id":"http://online.scuola.zanichelli.it/quartaprova/",
"updated":1350213486,
"feed":[
{
"href":"http://online.scuola.zanichelli.it/quartaprova/feed/"
}
],
"alternate":[
{
"href":"http://online.scuola.zanichelli.it/quartaprova/",
"type":"text/html"
}
],
"content":{
"direction":"ltr",
"content":"Un sito Zanichelli dedicato alle prove Invalsi di italiano e matematica: esercitazioni, consigli, informazioni utili, novità, aggiornamenti e blog d'autore sulle prove ..."
}
},
How can I get the feed URL?
That's what I do
NSString *daParsare=[reader searchFeed:searchText];
NSArray *items = [[daParsare JSONValue] objectForKey:@"items"];
for (NSDictionary *item in items) {
NSString *title = [item objectForKey:@"title"];
NSString *feed = [item valueForKeyPath:@"feed.href"];
}
[tab reloadData];
With the title everything is ok but when I try to access to the feed paramater I get the error...
© Stack Overflow or respective owner