Skip to content

Instantly share code, notes, and snippets.

View inonb's full-sized avatar

Inoue Takayuki inonb

View GitHub Profile
@inonb
inonb / gist:3158048
Created July 22, 2012 02:52
[iOS] アイコンをURLから取得する
// アイコンのプレースホルダを設定
cell.imageView.image = [UIImage imageNamed:@"placeholder"];
// アイコンのURLからリクエストを作る
NSString *iconURLString = [[[item objectForKey:@"im:image"] objectAtIndex:0] objectForKey:@"label"];
NSURL *iconURL = [NSURL URLWithString:iconURLString];
NSURLRequest *request = [NSURLRequest requestWithURL:iconURL];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
@inonb
inonb / gist:3158884
Created July 22, 2012 08:17
[iOS] itemをDetailViewControllerに渡す
DetailViewController.h
@property (strong, nonatomic) NSDictionary *item;
DetailViewController.m
@synthesize item;
MasterViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{