Я пытаюсь работать с JSON Feed для iphone, используя SBJSON Framework.Я попробовал сначала с примером, и он отлично работает.Но когда я сделал изменение с моим URL JSON, он не смог найти правильный ключ.Я не уверен, что я прав, так как я новичок в изучении JSON Framework для iphone.Ниже приведен мой канал JSON:
[
{
"place": null,
"in_reply_to_user_id": null,
"user": {
"notifications": null,
"friends_count": 37,
"profile_text_color": "000000",
"protected": false,
"is_translator": false,
"profile_sidebar_fill_color": "f1f6f9",
"location": "St. Louis, MO",
"name": "Annual Meeting",
"follow_request_sent": null,
"profile_background_tile": true,
"show_all_inline_media": false,
"geo_enabled": false,
"utc_offset": -18000,
"url": "http://www.center.org/meet",
"id_str": "15336703",
"following": null,
"verified": false,
"favourites_count": 0,
"profile_link_color": "CB2828",
"description": "Annual Meeting Twitterstream -- Join us in St. Louis, MO!",
"default_profile": false,
"created_at": "Sun Jul 06 23:26:33 +0000 2008",
"profile_sidebar_border_color": "000000",
"listed_count": 105,
"statuses_count": 400,
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/20080706-rh1nqc98x97hyg133ji774pix1.jpg",
"time_zone": "Eastern Time (US & Canada)",
"profile_image_url": "http://a1.twimg.com/profile_images/AnnualMeeting2011_Twitter_Icon_normal.jpg",
"profile_use_background_image": false,
"profile_image_url_https": "https://si0.twimg.com/profile_images/1257786946/AnnualMeeting2011_Twitter_Icon_normal.jpg",
"id": 15336703,
"profile_background_color": "015196",
"followers_count": 2311,
"screen_name": "11",
"contributors_enabled": false,
"profile_background_image_url": "http://a3.twimg.com/profile_background_images/20080706-rh1nqc98x97hyg133ji774pix1.jpg",
"default_profile_image": false,
"lang": "en"
},
"in_reply_to_status_id": null,
"text": "Acronym blog is seeking guest bloggers at #11 http://bit.ly/nlDUOe",
"id_str": "91972636405530624",
"favorited": false,
"created_at": "Fri Jul 10 20:49:19 +0000 2011",
"in_reply_to_status_id_str": null,
"geo": null,
"in_reply_to_screen_name": null,
"id": 91972636405530620,
"in_reply_to_user_id_str": null,
"source": "<a href=\"http://cotweet.com/?utm_source=sp1\" rel=\"nofollow\">CoTweet</a>",
"contributors": null,
"coordinates": null,
"retweeted": false,
"retweet_count": 2,
"truncated": false
},
Код для определения правильного ключа:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString *responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
[responseData release];
NSDictionary *results = [responseString JSONFragmentValue];
NSArray *allTweets = [results objectForKey:@"user"]; // ** Error on this line, dont know what key is the correct one ? **///
[viewController setTweets:allTweets];
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}