나는 LazyTableImages와 같이 비동기 적으로 Twitter JSON URL에 대한 이미지 파일을 다운로드하는 방법을 알아 내려고하고있다. 이 스크롤의 클라이언트 환경을 죽이지 않는되도록의 tableview를 스크롤하는 동안JSON 프로필 이미지 URL에 대한 트위터에 대한 피드
{
"completed_in": 0.132,
"max_id": 99177223541628930,
"max_id_str": "99177223541628928",
"next_page": "?page=2&max_id=99177223541628928&q=mobile&rpp=1",
"page": 1,
"query": "mobile",
"refresh_url": "?since_id=99177223541628928&q=mobile",
"results": [
{
"created_at": "Thu, 04 Aug 2011 17:57:47 +0000",
"from_user": "twhp_Bastary",
"from_user_id": 235609046,
"from_user_id_str": "235609046",
"geo": {
"coordinates": [
-2.6766,
118.8793
],
"type": "Point"
},
"id": 99177223541628930,
"id_str": "99177223541628928",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a1.twimg.com/profile_images/1431110298/315762105_normal.jpg",
"source": "<a href="http://ubersocial.com" rel="nofollow">ÜberSocial for BlackBerry</a>",
"text": "RT @DamnItsTrue: Good friends are priceless! #DamnItsTrue http://myloc.me/m9Kot",
"to_user_id": null,
"to_user_id_str": null
}
],
"results_per_page": 1,
"since_id": 0,
"since_id_str": "0"
}
핵심 profile_image_URL 될 비동기 적으로 이미지를로드 할 필요가 : 같은 JSON 파일 보인다. JSON을로드하는 데 사용되는 코드는 각 태그를 키로 사용하여 NSDictionary를 사용합니다.
NSDictionary *tweets = [twitter objectAtIndex:[indexPath row]];
cell.textLabel.text = [tweets objectForKey:@"text"];
cell.textLabel.font = [UIFont systemFontOfSize:14];
NSString *URL = [tweets objectForKey:@"profile_image_url"];
NSURL *url = [NSURL URLWithString:[tweets objectForKey:@"profile_image_url"]];
NSData *Tweetdata = [NSData dataWithContentsOfURL:url];
cell.imageView.image = [UIImage imageWithData:Tweetdata];
어디서 참조를 찾았습니까? URL이 – lifemoveson
입니다. 논리를 시도합니다 !! – lifemoveson