NSURL *url = [NSURL URLWithString:@\"http://i0.kym-cdn.com/entries/icons/original/000/005/545/OpoQQ.jpg?1302279173\"];
NSData *data = [NSData dataWithContentsOfURL:url]
You can use MBProgress Hud class for loading view. You can download only two classes from here :-https://github.com/jdg/MBProgressHUD After you write this code in that class which you want to load the data Example :In your viewDidLoad you write this
- (void) viewDidLoad
{
MBProgressHud *spinner = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
spinner.mode = MBProgressHUDModeCustomView;
[spinner setLabelText:@"Loading....."];
[spinner setLabelFont:[UIFont systemFontOfSize:15]];
[spinner show:YES];
[self performSelectorInBackground:@selector(getData) withObject:nil];
}
- (void) getData
{
NSURL *url = [NSURL URLWithString:@"http://i0.kym-cdn.com/entries/icons/original/000/005/545/OpoQQ.jpg?1302279173"];
NSData *data = [NSData dataWithContentsOfURL:url];
imageView.image = [[[UIImage imageWithData:data];
[spinner hide:YES];
[spinner removeFromSuperViewOnHide];
}