请考虑以下方法:
+(void)getGravatarFromEmail: (NSString *)email ofSize:(NSString *)size toImg:(UIImage *)myImg
{
NSString *hash = [md5 getMD5Hash:email]; // external method to calculate md5 hash
NSURL *gravatarUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://gravatar.com/avatar/%@?s=%@",hash,size]];
ASIHTTPRequest *request = [[ASIHTTPRequest alloc]initWithURL:gravatarUrl];
[request setCompletionBlock:^(void) {
NSData *data = [request responseData];
myImg = [UIImage imageWithData:data]; // ERROR HERE!!
}];
[request setDelegate:self];
[request startAsynchronous];
}
这种方法简单地要求格拉瓦塔尔找回图像。 然后,我将用光彩的形象更新我的记忆。
However, I m having errors trying to assign the image into myImg as commented in the code. The error is:
不可转让
这对我有什么影响?