Ios 在UIImageView中显示上载到drupal字段的图像
我正在使用Drupal SDK构建一个应用程序-一切都很好。我已让我的用户登录并成功上载照片。但是,一旦上传,我希望位于字段中的图像显示在UIImageView中。我正在使用SDImageWeb来完成这项工作,我只是不知道如何编写它?新来的问题 下面是成功将图像上传到Drupal字段(名为field_profile_photo)的代码: viewcontroller.mIos 在UIImageView中显示上载到drupal字段的图像,ios,objective-c,uiimageview,Ios,Objective C,Uiimageview,我正在使用Drupal SDK构建一个应用程序-一切都很好。我已让我的用户登录并成功上载照片。但是,一旦上传,我希望位于字段中的图像显示在UIImageView中。我正在使用SDImageWeb来完成这项工作,我只是不知道如何编写它?新来的问题 下面是成功将图像上传到Drupal字段(名为field_profile_photo)的代码: viewcontroller.m [DIOSFile fileSave:file success:^(AFHTTPRequestOperation *oper
[DIOSFile fileSave:file success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"File uploaded!");
[file setObject:[responseObject objectForKey:@"fid"] forKey:@"fid"];
[file removeObjectForKey:@"file"];
fid = [responseObject objectForKey:@"fid"];
NSLog(@"%@",responseObject);
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setObject: [NSString stringWithFormat:@"%@", fid] forKey:@"fid"];
NSLog(@"%@", fid);
NSDictionary *fidLangDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:dict] forKey:@"und"];
[userData setObject:@"1" forKey:@"uid"];
[userData setObject:fidLangDict forKey:@"field_profile_photo"];
[DIOSUser
userUpdate:userData
success:^(AFHTTPRequestOperation *op, id response) { /* Handle successful operation here */
NSLog(@"User data updated!");
}
failure:^(AFHTTPRequestOperation *op, NSError *err) { /* Handle operation failire here */
NSLog(@"User data failed to update!");
}
];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Failed to upload file!");
}];
}
当我刷新此视图时,我现在希望上传的照片显示在imageview中。我想是这样的吧?有人知道我如何将在field\u profile\u photo生成的URL进行二次链接吗?我希望我问得对。救命啊
NSString *secondLink = [self.photoData setObject:imageView forKey:@"field_profile_photo"];
[self.imageView sd_setImageWithURL:[NSURL URLWithString:secondLink]];
我已经在我的表格单元格中这样写了它,它可以工作(在另一个项目中),但是我很好奇,当我的imageview只是在一个视图中时,我该如何写它
NSString *secondLink = [[self.descripData objectAtIndex:indexPath.row] objectForKey:@"field_profile_photo"];
[cell.itemPhoto sd_setImageWithURL:[NSURL URLWithString:secondLink]];
但是我不能理解你的问题。你能简化你的问题吗problem@MohamadFarhand我想知道如何显示我刚刚上传到UIImageView中Drupal字段(字段\个人资料\照片)中的图像:)我想您可以在块完成后通知视图并更新uimageview的图像。@MohamadFarhand我知道,但我仍然需要一行代码将图像的数据/url从Drupal字段拉到UIImageView?sry,但我无法理解您的问题。你能简化你的问题吗problem@MohamadFarhand我想知道如何显示我刚刚上传到UIImageView中Drupal字段(字段\个人资料\照片)中的图像:)我想您可以在块完成后通知视图并更新uimageview的图像。@MohamadFarhand我知道,但我仍然需要一行代码将图像的数据/url从Drupal字段拉到UIImageView?