Skip to content

Instantly share code, notes, and snippets.

@toshikaz55
Created April 9, 2014 01:08
Show Gist options
  • Save toshikaz55/10215823 to your computer and use it in GitHub Desktop.
Save toshikaz55/10215823 to your computer and use it in GitHub Desktop.
iOSでWeb上の画像をUIIまげに表示する
// URL文字列の生成
NSURL *myURL = [NSURL URLWithString:@"http://www.ymori.com/itest/sample.jpg"];
// 素のデータを作成
NSData *myData = [NSData dataWithContentsOfURL:myURL];
// データを画像に変換
UIImage *myImage = [UIImage imageWithData:myData];
self.myImageView.image = myImage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment